#! /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
# that allow multiple testcases in a single test script. In particular,
# check that this still works when we override $(TESTS) and $(TEST_LOGS)
# at make runtime.
-# See also related tests 'test-driver-custom-multitest-recheck.test' and
-# 'parallel-tests-recheck-override.test'.
+# See also related tests 'test-driver-custom-multitest-recheck.sh' and
+# 'parallel-tests-recheck-override.sh'.
-. ./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"
cat >> configure.ac << 'END'
$srcdir/configure
: Run the tests for the first time.
- $MAKE check >stdout && { cat stdout; exit 1; }
- cat stdout
+ run_make -O -e FAIL check
# All the test scripts should have run.
test -f a.run
test -f b.run
: An empty '$(TESTS)' or '$(TEST_LOGS)' means that no test should be run.
for var in TESTS TEST_LOGS; do
- env "$var=" $MAKE -e recheck >stdout || { cat stdout; exit 1; }
- cat stdout
+ run_make -O "$var=" recheck
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run
unset var
: a.test was successful the first time, no need to re-run it.
- env TESTS=a.test $MAKE -e recheck >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ using_gmake || $sleep # Required by BSD make.
+ run_make -O TESTS=a.test recheck
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run
test ! -e c.run
: b.test failed, it should be re-run. And make it pass this time.
+ using_gmake || $sleep # Required by BSD make.
echo OK > b.ok
- TEST_LOGS=b.log $MAKE -e recheck >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ run_make -O TEST_LOGS=b.log recheck
test ! -e a.run
test -f b.run
test ! -e c.run
rm -f *.run
: No need to re-run a.test or b.test anymore.
- TEST_LOGS=b.log $MAKE -e recheck >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ using_gmake || $sleep # Required by BSD make.
+ run_make -O TEST_LOGS=b.log recheck
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run
test ! -e c.run
- TESTS='a.test b.test' $MAKE -e recheck >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ using_gmake || $sleep # Required by BSD make.
+ run_make -O TESTS='a.test b.test' recheck
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run
: as it contained an XPASS. And this time, make it fail with
: an hard error.
echo dummy > c.err
- env TEST_LOGS='a.log c.log' $MAKE -e recheck >stdout \
- && { cat stdout; exit 1; }
- cat stdout
+ run_make -e FAIL -O TEST_LOGS='a.log c.log' recheck
count_test_results total=1 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=1
test ! -e a.run
test ! -e b.run
: c.test contained and hard error the last time, so it should be re-run.
: This time, make it pass
# Use 'echo', not ':'; see comments above for why.
+ using_gmake || $sleep # Required by BSD make.
echo dummy > c.ok
- env TESTS='c.test a.test' $MAKE -e recheck >stdout \
- || { cat stdout; exit 1; }
- cat stdout
+ run_make -O TESTS='c.test a.test' recheck
count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run
: Nothing should be rerun anymore, as all tests have been eventually
: successful.
- $MAKE recheck >stdout || { cat stdout; exit 1; }
- cat stdout
+ using_gmake || $sleep # Required by BSD make.
+ run_make -O recheck
count_test_results total=0 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=0
test ! -e a.run
test ! -e b.run