[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] {msvc} tests: few improvements to some `ar-lib' related tests
From: |
Stefano Lattarini |
Subject: |
[PATCH] {msvc} tests: few improvements to some `ar-lib' related tests |
Date: |
Tue, 25 Oct 2011 13:44:29 +0200 |
User-agent: |
KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) |
I'd like to push the attached patch to the `msvc' branch.
Peter, could you take a look at the patch, and preferably also
test it? I want to have your ACK before proceeding.
Thanks.
Stefano
From 4407ee34026b3eebeca5ff9d3e737f3f4a4b7bdf Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Stefano Lattarini <address@hidden>
Date: Tue, 25 Oct 2011 13:43:00 +0200
Subject: [PATCH] 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.
---
ChangeLog | 16 ++++++++++++++++
tests/ar-lib5a.test | 9 ++++++---
tests/ar-lib5b.test | 26 +++++++++++++++++++++-----
3 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 003b69a..3f50e29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-10-25 Peter Rosin <address@hidden>
+
+ 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 <address@hidden>
Merge branch 'maint' into msvc
diff --git a/tests/ar-lib5a.test b/tests/ar-lib5a.test
index cb73f92..fb09c5b 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,9 +52,11 @@ int wish(void) { return 0; }
END
mkdir auxdir
-cat > auxdir/ar-lib << 'END'
-# /bin/sh
-:> ar-lib-worked
+# FIXME: make this "installcheck-aware" once we are merged into the
+# 'testsuite-work' branch.
+cat - "$testsrcdir"/../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 181c24b..52deab5 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=:"
:
--
1.7.2.3
- [PATCH] {msvc} tests: few improvements to some `ar-lib' related tests,
Stefano Lattarini <=