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 $MAKE -e check
&& exit 1
68 env RECHECK_LOGS
= $MAKE -e check
> stdout
&& { cat stdout
; exit 1; }
72 grep '^PASS: foo\.test 1$' stdout
73 grep '^PASS: foo\.test 2$' stdout
74 grep '^FAIL: bar\.test 1$' stdout
75 grep 'baz\.test' stdout
&& exit 1
80 # We re-run only a successful test, but the tests that failed in the
81 # previous run should still be taken into account, and cause an overall
83 env RECHECK_LOGS
= $MAKE -e check
> stdout
&& { cat stdout
; exit 1; }
85 grep '^PASS: foo\.test 1$' stdout
86 grep '^PASS: foo\.test 2$' stdout
87 grep 'ba[rz]\.test' stdout
&& exit 1
88 is_newest foo.log foo.
test
93 env RECHECK_LOGS
= $MAKE -e check
> stdout
&& { cat stdout
; exit 1; }
95 grep '^ERROR: baz\.test' stdout
96 $EGREP '(foo|bar)\.test' stdout
&& exit 1
97 is_newest baz.log zardoz
100 # Now, explicitly retry with all test logs already updated, and ensure
101 # that the summary is still displayed.
102 env RECHECK_LOGS
= $MAKE -e check
> stdout
&& { cat stdout
; exit 1; }
104 $EGREP '(foo|bar|baz)\.test' stdout
&& exit 1
107 # The following should re-run foo.test (and only foo.test), even if its
108 # log file is up-to-date.
110 env RECHECK_LOGS
=foo.log
$MAKE -e check
> stdout
&& { cat stdout
; exit 1; }
112 grep '^PASS: foo\.test 1$' stdout
113 grep '^PASS: foo\.test 2$' stdout
114 grep 'ba[rz]\.test' stdout
&& exit 1
115 is_newest foo.log older