2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 cat > Makefile.am << 'END'
23 TEST_LOG_COMPILER = cat
24 TESTS = foo.test bar.test baz.test
32 cat > foo.test <<'END'
38 cat > bar.test <<'END'
43 cat > baz.test <<'END'
48 # Even the tests that are not re-run should contribute to the testsuite
49 # summary when obtained by "make check RECHECK_LOGS=".
52 grep '^# TOTAL: *4$' stdout
53 grep '^# PASS: *2$' stdout
54 grep '^# XPASS: *0$' stdout
55 grep '^# FAIL: *1$' stdout
56 grep '^# XFAIL: *0$' stdout
57 grep '^# SKIP: *0$' stdout
58 grep '^# ERROR: *1$' stdout
61 run_make -e FAIL check
68 run_make -O -e FAIL check RECHECK_LOGS=
71 grep '^PASS: foo\.test 1$' stdout
72 grep '^PASS: foo\.test 2$' stdout
73 grep '^FAIL: bar\.test 1$' stdout
74 grep 'baz\.test' stdout && exit 1
79 # We re-run only a successful test, but the tests that failed in the
80 # previous run should still be taken into account, and cause an overall
82 run_make -O -e FAIL check RECHECK_LOGS=
83 grep '^PASS: foo\.test 1$' stdout
84 grep '^PASS: foo\.test 2$' stdout
85 grep 'ba[rz]\.test' stdout && exit 1
86 is_newest foo.log foo.test
91 run_make -O -e FAIL check RECHECK_LOGS=
92 grep '^ERROR: baz\.test' stdout
93 $EGREP '(foo|bar)\.test' stdout && exit 1
94 is_newest baz.log zardoz
97 # Now, explicitly retry with all test logs already updated, and ensure
98 # that the summary is still displayed.
99 run_make -O -e FAIL check RECHECK_LOGS=
100 $EGREP '(foo|bar|baz)\.test' stdout && exit 1
103 # The following should re-run foo.test (and only foo.test), even if its
104 # log file is up-to-date.
106 run_make -O -e FAIL check RECHECK_LOGS=foo.log
107 grep '^PASS: foo\.test 1$' stdout
108 grep '^PASS: foo\.test 2$' stdout
109 grep 'ba[rz]\.test' stdout && exit 1
110 is_newest foo.log older