libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid leaking make flags into testsuite results.


From: Ralf Wildenhues
Subject: Avoid leaking make flags into testsuite results.
Date: Wed, 1 Sep 2010 21:31:07 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

I'm committing the following bug fix, with code taken from
automake/tests/defs.in and adapted for Libtool.  It ought to fix about
a third of all the failures in all the autobuild logs; e.g., tests 107
and 109 seen in this log:
<http://autobuild.josefsson.org/libtool/log-201008291316239205000.txt>

| ../../libtool/tests/configure-iface.at:153: $MAKE -q main$EXEEXT || exit 1
| stderr:
| stdout:
| Don't know how to make libltdl/libltdl.la
| `main' not remade because of errors
| ../../libtool/tests/configure-iface.at:153: exit code was 0, expected 1
| 107. configure-iface.at:102: 107. installable libltdl 
(configure-iface.at:102): FAILED (configure-iface.at:153)

This one has been particularly nasty because rerunning the test itself
made the failure go away, and there is no indication in the log that -k was
used (only transported to the inner make through the MAKEFLAGS environment
variable).

It also fixes jobserver warnings seen, e.g., in tests/demo-make.log with
  make -j3 check-TESTS TESTS='tests/demo-conf.test tests/demo-make.test'

| PASS: tests/demo-make.test (exit: 0)
| ====================================
| 
| demo-make.test: ===  Running demo-make.test
| demo-make.test: ===  Running `make ' in demo
| make[5]: Entering directory `/tmp/build/tests/demo'
| make[5]: warning: jobserver unavailable: using -j1.  Add `+' to parent make 
rule.
[...]

It also fixes a couple more spurious failures that I've been struggling
with: for example, demo-noinst-link.test fails on several systems, e.g.:
<http://autobuild.josefsson.org/libtool/log-201008291627005279000.txt>

| libtool: link: /opt/fsw/gcc42/bin/gcc -g -O2 -o .libs/hell main.o  -L./.libs 
-lhello -lm -Wl,+b 
-Wl,/tmp/lt/build-hppa2.0w-hp-hpux11.23-gcc/tests/demo/.libs:/tmp/lt/build-hppa2.0w-hp-hpux11.23-gcc/_inst-demo/lib
| /usr/ccs/bin/ld: Unsatisfied symbols:
|    nothing (first referenced in main.o) (data)
|    foo (first referenced in main.o) (code)
| collect2: ld returned 1 exit status
| *** Error exit code 1
| demo-noinst-link.test: ===  Succeeded: this means the installed library was 
used, which is wrong
| 
| FAIL: tests/f77demo-exec.test (exit: 1)

and that, too is a $MAKE ... command not failing when it should.

Cheers,
Ralf

    Avoid leaking make flags into testsuite results.
    
    * tests/defs.m4sh: Unset MFLAGS, MAKEFLAGS, MAKELEVEL, __MKLVL__
    and MAKE_JOBS_FIFO.
    * tests/testsuite.at: Likewise.
    Fixes warnings in test logs when the user uses 'make -jN check'
    and inner $MAKE invocations can't connect to the job server.
    Fixes spurious failures of configure-iface.at and of
    demo-noinst-link tests with BSD and Tru64 make if the user uses
    'make -k', as the exit status of the latter is not reliable.

diff --git a/tests/defs.m4sh b/tests/defs.m4sh
index 0d23dea..b56426f 100644
--- a/tests/defs.m4sh
+++ b/tests/defs.m4sh
@@ -346,6 +346,11 @@ m4dir=$srcdir/libltdl/m4
 auxdir=$srcdir/libltdl/config
 scripts="$auxdir/ltmain.m4sh $srcdir/libtoolize.m4sh"
 
+# Unset some MAKE... variables that may cause $MAKE to act like a
+# recursively invoked sub-make.  Any $MAKE invocation in a test is
+# conceptually an independent invocation.
+unset MFLAGS MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO
+
 # On AIX, shared libraries remain loaded in memory after use if they
 # are world-readable, until root issues slibclean.  On NFS, this causes
 # a testsuite rerun to fail to clean up test group directories.  Avoid
diff --git a/tests/testsuite.at b/tests/testsuite.at
index a20e074..c646c5d 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -61,6 +61,11 @@ case $lt_INSTALL in
     ;;
 esac
 
+# Unset some MAKE... variables that may cause $MAKE to act like a
+# recursively invoked sub-make.  Any $MAKE invocation in a test is
+# conceptually an independent invocation.
+unset MFLAGS MAKEFLAGS MAKELEVEL __MKLVL__ MAKE_JOBS_FIFO
+
 # On AIX, shared libraries remain loaded in memory after use if they
 # are world-readable, until root issues slibclean.  On NFS, this causes
 # a testsuite rerun to fail to clean up test group directories.  Avoid



reply via email to

[Prev in Thread] Current Thread [Next in Thread]