2 # Copyright (C) 2011 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-tests features: runtime redefinition of $(TEST_SUITE_LOG)
18 # for the recheck target.
25 cat >> configure.in <<'END'
29 cat > Makefile.am <<'END'
30 TESTS = foo.test bar.test baz.test
33 cat > foo.test <<'END'
39 cat > bar.test <<'END'
45 cat > baz.test <<'END'
48 exit ${BAZ_EXIT_STATUS-1}
53 unset BAZ_EXIT_STATUS || :
60 $MAKE check >stdout && { cat stdout; Exit 1; }
63 chmod a-rw test-suite.log
64 TEST_SUITE_LOG=my.log $MAKE -e recheck >stdout \
65 && { cat stdout; Exit 1; }
68 grep '^2 of 2 .*failed' stdout
69 for x in stdout my.log; do
70 $FGREP foo.test $x && Exit 1
76 BAZ_EXIT_STATUS=0 TEST_SUITE_LOG=my2.log $MAKE -e recheck >stdout \
77 && { cat stdout; Exit 1; }
80 grep '^1 of 2 .*failed' stdout
81 $FGREP foo.test stdout && Exit 1
82 $FGREP bar.test stdout
83 $FGREP baz.test stdout
84 $FGREP foo.test my2.log && Exit 1
85 $FGREP bar.test my2.log
86 $FGREP baz.test my2.log && Exit 1
88 chmod u+r test-suite.log my.log
89 $FGREP baz.test test-suite.log
90 $FGREP baz.test my.log