From: Stefano Lattarini Date: Tue, 25 Oct 2011 11:43:00 +0000 (+0200) Subject: tests: few improvements to some `ar-lib' related tests X-Git-Tag: ng-0.5a~101^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=821f88c3c7db37413c1e70722dad4a30a6c83afb;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 003b69a17..fb29ef7c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2011-10-25 Stefano Lattarini + + 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 Merge branch 'maint' into msvc diff --git a/tests/ar-lib5a.test b/tests/ar-lib5a.test index cb73f92df..d1de98b32 100755 --- a/tests/ar-lib5a.test +++ b/tests/ar-lib5a.test @@ -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 diff --git a/tests/ar-lib5b.test b/tests/ar-lib5b.test index 181c24bf7..52deab5fd 100755 --- a/tests/ar-lib5b.test +++ b/tests/ar-lib5b.test @@ -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=:" :