]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: few improvements to some `ar-lib' related tests
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 25 Oct 2011 11:43:00 +0000 (13:43 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 25 Oct 2011 13:32:22 +0000 (15:32 +0200)
* tests/ar-lib5a.test (Makefile.am): Also check that the target
library has truly been created.
(ar-lib): Use the real `ar-lib' script (mildly patched) rather
than a dummy one, to ensure better "real-life coverage".  Fix
botched shebang line.
* tests/ar-lib5b.test: Extend the PATH variable to make the dummy
`lib' script accessible, instead of explicitly calling it by its
relative/absolute path.
(ar-lib): Fix botched shebang line.
(bin/lib): Likewise.  Also, add explicative comments, and make
slightly stricter.

ChangeLog
tests/ar-lib5a.test
tests/ar-lib5b.test

index 003b69a173b79aa486e3853d995c4cac5350020f..fb29ef7c311ac713554ac93a2073ffec9b9a9202 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-10-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: few improvements to some `ar-lib' related tests
+
+       * tests/ar-lib5a.test (Makefile.am): Also check that the target
+       library has truly been created.
+       (ar-lib): Use the real `ar-lib' script (mildly patched) rather
+       than a dummy one, to ensure better "real-life coverage".  Fix
+       botched shebang line.
+       * tests/ar-lib5b.test: Extend the PATH variable to make the dummy
+       `lib' script accessible, instead of explicitly calling it by its
+       relative/absolute path.
+       (ar-lib): Fix botched shebang line.
+       (bin/lib): Likewise.  Also, add explicative comments, and make
+       slightly stricter.
+
 2011-10-24  Peter Rosin  <peda@lysator.liu.se>
 
        Merge branch 'maint' into msvc
index cb73f92dff377a19073b034c89e54b1b728417ad..d1de98b32b79abb78172d26146085804774d16d1 100755 (executable)
@@ -43,6 +43,7 @@ libwish_a_SOURCES = wish.c
 check-local:
        test x'$(am_cv_ar_interface)' = x'lib'
        test -f ar-lib-worked
+       test -f libwish.a
 MOSTLYCLEANFILES = ar-lib-worked
 END
 
@@ -51,8 +52,10 @@ int wish(void) { return 0; }
 END
 
 mkdir auxdir
-cat > auxdir/ar-lib << 'END'
-# /bin/sh
+# FIXME: make this "installcheck-aware" once we are merged into the
+#        'testsuite-work' branch.
+cat - "$testsrcdir"/../lib/ar-lib > auxdir/ar-lib << 'END'
+#! /bin/sh
 :> ar-lib-worked
 END
 chmod +x auxdir/ar-lib
index 181c24bf70268e277c8d13fc4543809af6bd4ca2..52deab5fd9001092a99943dfa089aa0c07729697 100755 (executable)
@@ -51,7 +51,7 @@ END
 
 mkdir auxdir
 cat > auxdir/ar-lib << 'END'
-# /bin/sh
+#! /bin/sh
 :> ar-lib-worked
 END
 chmod +x auxdir/ar-lib
@@ -59,14 +59,30 @@ chmod +x auxdir/ar-lib
 # Let's fake microsoft lib.
 mkdir bin
 cat > bin/lib << 'END'
-# /bin/sh
+#! /bin/sh
+echo lib command line: $* >&2 # For debugging.
 case " $* " in
+  # The `-OUT:' option is used by tests in configure.  So don't create
+  # the `ar-lib-worked' file here, as that might cause spurious passes
+  # of this test; but don't fail either, as that would confuse said
+  # configure tests.
   *' -OUT:'*) exit 0;;
-  *' cru '*) exit 1;;
+  # This means that $* looks like a command-line for `ar'.  We have to
+  # exit with failure here, to accomodate the two following ortoghonal
+  # scenarios:
+  #  1. when `lib' is tested by configure, this will tell that it does
+  #     not use the ar(1) interface, so that the `ar-lib' script will
+  #     get involved;
+  #  2. when `lib' is called by the Makefile, an ar-style command line
+  #     passed to it would mean that the `ar-lib' script has failed to
+  #     properly munge the command line, or hasn't been invoked to do so.
+  *\ c*) exit 1;;
+  # Assume everything else is OK.
   *) : > ar-lib-worked;;
 esac
 END
 chmod +x bin/lib
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
 
 $ACLOCAL
 $AUTOCONF
@@ -75,9 +91,9 @@ $AUTOMAKE --add-missing
 # Sanity check: test that it is ok to use `am_cv_ar_interface' as we do.
 $FGREP 'am_cv_ar_interface=' configure
 
-./configure AR=bin/lib RANLIB=:
+./configure AR=lib RANLIB=:
 
 $MAKE check
-$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="AR=`pwd`/bin/lib RANLIB=:"
+$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="AR=lib RANLIB=:"
 
 :