test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / tap-bailout-suppress-badexit.sh
old mode 100755 (executable)
new mode 100644 (file)
index 1962639..8f5fb15
@@ -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
@@ -18,8 +18,7 @@
 #  - A "Bail out!" directive causes the driver to ignore the exit
 #    status of the test script.
 
-am_parallel_tests=yes
-. ./defs || Exit 1
+. test-init.sh
 
 tests='exit.test exit127.test sighup.test sigterm.test'
 
@@ -27,7 +26,7 @@ cat > Makefile.am <<END
 TESTS = $tests
 END
 
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
 
 cat > exit.test << 'END'
 #!/bin/sh
@@ -55,11 +54,10 @@ END
 
 chmod a+x $tests
 
-$MAKE check >stdout && { cat stdout; Exit 1; }
-cat stdout
-
+run_make -O -e FAIL check
 count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=4
+
 for tst in $tests; do grep "^ERROR: $tst - Bail out!" stdout; done
-$EGREP "ERROR: .*(exit.*status|terminat.*signal)" stdout && Exit 1
+$EGREP "ERROR: .*(exit.*status|terminat.*signal)" stdout && exit 1
 
 :