test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / test-driver-cond.sh
old mode 100755 (executable)
new mode 100644 (file)
index ac0b3f1..febb9d2
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #   - Automake can correctly handle conditionals contents for the
 #     LOG_DRIVER variables.
 
-am_parallel_tests=yes
-. ./defs || Exit 1
+. test-init.sh
 
-cp "$am_testauxdir"/trivial-test-driver . \
+cp "$am_testaux_srcdir"/trivial-test-driver . \
   || fatal_ "failed to fetch auxiliary script trivial-test-driver"
 cp "$am_scriptdir"/tap-driver.pl . \
   || fatal_ "failed to fetch auxiliary script tap-driver.pl"
@@ -59,7 +58,7 @@ cat > foo <<'END'
 #!/bin/sh
 echo "PASS: from $0"
 echo "SKIP: from $0"
-exit 1 # Exit status should be ignored by the trivial-test-driver.
+exit 1 # exit status should be ignored by the trivial-test-driver.
 END
 
 cat > bar.test <<'END'
@@ -80,7 +79,7 @@ chmod a+x foo bar.test baz.sh
 $AUTOMAKE -a
 test -f test-driver
 
-grep DRIVER Makefile.in || Exit 99 # For debugging.
+grep DRIVER Makefile.in || exit 99 # For debugging.
 
 grep '^my_LOG_DRIVER *=' Makefile.in \
   && fatal_ 'unexpected $(my_LOG_DRIVER) in Makefile.in'
@@ -103,17 +102,15 @@ do_count ()
   $EGREP 'XFAIL: baz\.sh 3( |$)' stdout
 }
 
-st=0; $MAKE check >stdout || st=$?
-cat stdout
+run_make -O -e IGNORE check
 cat test-suite.log
 cat foo.log
 cat bar.log
 cat baz.log
-test $st -eq 0 || Exit 1
+test $am_make_rc -eq 0 || exit 1
 do_count
 
-$MAKE distcheck >stdout || { cat stdout; Exit 1; }
-cat stdout
+run_make -O distcheck
 do_count
 
 :