]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: avoid spurious failure with NetBSD /bin/ksh
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Feb 2012 21:24:35 +0000 (22:24 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Feb 2012 22:59:46 +0000 (23:59 +0100)
* tests/parallel-tests-fd-redirect-exeext.test (configure.in): Tweak
so that we don't end up with the generated configure script having
two nested subshells that start with '((':

  ((./conftest$EXEEXT 9>&1) | grep "^foobar") >&5 2>&5

which is unportable and could confuse some shells (e.g., NetBSD 5.1
/bin/ksh) into thinking we are trying to perform an arithmetic
operation.

tests/parallel-tests-fd-redirect-exeext.test

index 0f9d6da3320722e6577184ad137585222795d769..4426604a544525b50e5d28d57e2fc0ddbfc8fa55 100755 (executable)
@@ -34,7 +34,11 @@ AC_LINK_IFELSE(
     [AC_LANG_PROGRAM([[#include <unistd.h>]],
                      [[write (9, "foobar\n", 7); return 0;]])],
     [AM_RUN_LOG([./conftest$EXEEXT 9>&1]) \
-       && AM_RUN_LOG([(./conftest$EXEEXT 9>&1) | grep "^foobar"]) \
+dnl Leading ":;" required to avoid having two nested subshells starting
+dnl with '((' in the generated configure: that is unportable and could
+dnl confuse some shells (e.g., NetBSD 5.1 /bin/ksh) into thinking we are
+dnl trying to perform an arithmetic operation.
+       && AM_RUN_LOG([:; (./conftest$EXEEXT 9>&1) | grep "^foobar"]) \
        && am__ok=yes])
 test $am__ok = yes || AS_EXIT([63])
 AM_CONDITIONAL([real_EXEEXT], [test -n "$EXEEXT"])