tests: don't risk hanging on the 'cl' requirement
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 27 Jun 2013 09:11:35 +0000 (11:11 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 27 Jun 2013 09:12:22 +0000 (11:12 +0200)
On the GNU/Linux boxes of some users that run our testsuite there
is a '/usr/local/bin/cl' executable, from the IRAF package:

    <http://iraf.noao.edu/>

The test 'compile4.sh' (and other tests) try to invoke the 'cl'
command to check whether it's a Microsoft compiler; the IRAF cl
is an interactive program, so it hangs on such invocation.  In
conclusion, the testsuite hangs for those users which have the
IRAF cl early in PATH.

Fix the issue by redirecting the input of cl from /dev/null when
invoking it, which is enough to prevent the cl program from IRAF
from hanging, and should have no effect on the behaviour of the
Microsoft compiler.

This change fixes automake bug#14707.

* t/ax/am-test-lib.sh (require_tool): Adjust the handling of
the 'cl' requirement.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/ax/am-test-lib.sh

index 182b070..26e58ef 100644 (file)
@@ -788,7 +788,11 @@ require_tool ()
       # in the environment "by hand" before calling the testsuite.
       export CC CPPFLAGS
       echo "$me: running $CC -?"
-      $CC -? || skip_all_ "Microsoft C compiler '$CC' not available"
+      # The IRAF package (http://iraf.noao.edu/) contains a 'cl' program
+      # which is interactive, and which could cause the testsuite to hang
+      # if its standard input is not redirected.  See automake bug#14707.
+      $CC -? </dev/null \
+        || skip_all_ "Microsoft C compiler '$CC' not available"
       ;;
     etags)
       # Exuberant Ctags will create a TAGS file even