#! /bin/sh
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-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
./configure
-$MAKE check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
test -f test-suite.log
cat test-suite.log
# Note that this usage has a problem: the summary will only
# take bar.log into account, because the $(TEST_SUITE_LOG) rule
# does not "see" baz.log. Hmm.
-env TESTS='bar.test' $MAKE -e check >stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS='bar.test' check
grep '^FAIL: baz\.test$' stdout
grep '^ERROR: bar\.test$' stdout
# Note that the previous test and this one taken together expose the timing
# issue that requires the check-TESTS rule to always remove TEST_SUITE_LOG
# before running the tests lazily.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
test -f foo.log
grep '^PASS: foo\.test$' stdout
grep bar.test stdout && exit 1
# Now, explicitly retry with all test logs already updated, and ensure
# that the summary is still displayed.
-env RECHECK_LOGS= $MAKE -e check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=
grep foo.test stdout && exit 1
grep bar.test stdout && exit 1
grep baz.test stdout && exit 1
grep '^# ERROR: *1$' stdout
# Lazily rerunning only foo should only rerun this one test.
-env RECHECK_LOGS=foo.log $MAKE -e check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL check RECHECK_LOGS=foo.log
grep foo.test stdout
grep bar.test stdout && exit 1
grep baz.test stdout && exit 1
grep '^# ERROR: *1$' stdout
$MAKE clean
-env TEST_LOGS=baz.log $MAKE -e check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TEST_LOGS=baz.log check
grep foo.test stdout && exit 1
grep bar.test stdout && exit 1
grep baz.test stdout
$MAKE clean
-env TESTS=baz.test $MAKE -e check > stdout && { cat stdout; exit 1; }
-cat stdout
+run_make -O -e FAIL TESTS=baz.test check
grep foo.test stdout && exit 1
grep bar.test stdout && exit 1
grep baz.test stdout