2 # Copyright (C) 2011-2012 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/>.
17 # Check parallel harness features:
18 # - recovery from unreadable '.trs' files, in various scenarios
23 cat >> configure.ac <<END
27 cat > Makefile.am << 'END'
28 TESTS = foo.test bar.test
29 TEST_LOG_COMPILER = true
35 TEST_STATUS=0; export TEST_STATUS
45 test ! -r t || Exit 77
48 : Create the required log files.
53 : Recreate with a sweeping "make check".
61 : Again, this time with one .trs file missing and the other
71 : Again, but using "make recheck" this time.
74 $MAKE recheck >stdout || { cat stdout; Exit 1; }
80 grep '^PASS: foo\.test' stdout
81 grep '^PASS: bar\.test' stdout
83 : More complex interactions with "make recheck" are OK.
84 chmod a-r bar.log bar.trs
85 $MAKE recheck >stdout || { cat stdout; Exit 1; }
89 grep '^PASS: bar\.test' stdout
90 grep 'foo\.test' stdout && Exit 1
91 count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
93 : Recreate by remaking the global test log.
96 $MAKE test-suite.log >stdout || { cat stdout; Exit 1; }
100 grep '^PASS: foo\.test' stdout
101 grep 'bar\.test' stdout && Exit 1
102 # Also test that have only run before should be counted in the final
104 grep '^# TOTAL: *2$' stdout
106 : Setup for the next check.
108 sed 's/^TESTS =.*/& baz.test/' Makefile > t
109 diff t Makefile && Exit 99
116 : Interactions with lazy test reruns are OK.
122 RECHECK_LOGS= $MAKE -e check >stdout || { cat stdout; Exit 1; }
125 is_newest bar.trs bar.test
126 grep '^PASS: foo\.test' stdout
127 grep '^PASS: bar\.test' stdout
128 grep 'baz\.test' stdout && Exit 1
129 # Also test that have only run before should be counted in the final
131 grep '^# TOTAL: *3$' stdout