Avoid a test failure when the test wants to skip itself.
authorBruno Haible <bruno@clisp.org>
Wed, 11 Jun 2008 23:12:11 +0000 (01:12 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 11 Jun 2008 23:12:11 +0000 (01:12 +0200)
ChangeLog
tests/test-vc-list-files-cvs.sh
tests/test-vc-list-files-git.sh

index 8d5771d..0e6fdf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-06-10  Bruno Haible  <bruno@clisp.org>
 
+       * tests/test-vc-list-files-git.sh: Make double use of 'exit'. Needed
+       for $? to work inside the trap command, with various /bin/sh-s.
+       * tests/test-vc-list-files-cvs.sh: Likewise.
+
+2008-06-10  Bruno Haible  <bruno@clisp.org>
+
        * lib/acl-internal.h: Don't include gettext.h here.
        * lib/set-mode-acl.c: Include gettext.h here.
        * lib/copy-acl.c: Likewise.
index c94932f..c87267c 100755 (executable)
@@ -44,7 +44,8 @@ for i in with-cvsu without; do
   ok=0
   mkdir $tmpdir && cd $tmpdir &&
     # without cvs, skip the test
-    { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 || exit 77; } &&
+    # The double use of 'exit' is needed for the reference to $? inside the trap.
+    { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 || { (exit 77); exit 77; }; } &&
     mkdir w && cd w &&
     mkdir d &&
     touch d/a b c &&
index 3a669dd..ac50971 100755 (executable)
@@ -31,7 +31,8 @@ trap '(exit $?); exit $?' 1 2 13 15
 fail=1
 mkdir $tmpdir && cd $tmpdir &&
   # without git, skip the test
-  { ( git init -q ) > /dev/null 2>&1 || exit 77; } &&
+  # The double use of 'exit' is needed for the reference to $? inside the trap.
+  { ( git init -q ) > /dev/null 2>&1 || { (exit 77); exit 77; }; } &&
   mkdir d &&
   touch d/a b c &&
   git add . > /dev/null &&