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 # Parallel testsuite harness: check APIs for the registering the
18 # "global test result" in '*.trs' files, as documented in the automake
24 cat >> configure.ac << 'END'
28 cat > Makefile.am << 'END'
29 TEST_EXTENSIONS = .test .x
30 TEST_LOG_DRIVER = ./dummy-driver
31 X_LOG_DRIVER = ./dummy-driver
32 TESTS = foo.test zar-doz.test
35 cat > dummy-driver <<'END'
38 while test $# -gt 0; do
40 --log-file) log_file=$2; shift;;
41 --trs-file) trs_file=$2; shift;;
42 --test-name) test_name=$2; shift;;
43 --expect-failure|--color-tests|--enable-hard-errors) shift;;
45 *) echo "$0: invalid option/argument: '$1'" >&2; exit 2;;
49 echo logloglog > $log_file
52 chmod a+x dummy-driver
54 # Do this in a subroutine to avoid quoting problem in the backticked
55 # command substitution below.
58 sed -e 's,[$^/\\\.],\\&,g' -e 1q "$@"
63 cat > exp; echo >> exp; echo logloglog >> exp
64 eline=`get_escaped_line exp`
65 sed -n -e "/^$eline$/,/^logloglog$/p" test-suite.log > got
78 echo :global-test-result: PASS > foo.test
79 echo :global-test-result: ERROR > zar-doz.x
94 : Try usage documented in the manual.
96 echo :global-test-result: PASS/SKIP > foo.test
97 echo :global-test-result: ALMOST PASSED > zar-doz.x
108 ALMOST PASSED: zar-doz
109 ======================
112 : Fields ':test-result:' does not interfere with the global test result.
114 cat > foo.test << 'END'
116 :global-test-result: PASS
120 cat > zar-doz.x << 'END'
121 :global-test-result: FAIL
126 $MAKE check && Exit 1
139 : What happens when ':global-test-result:' is absent.
141 cat > foo.test << 'END'
147 $MAKE check && Exit 1
160 # Leading and trailing whitespace gets eaten/normalized.
162 echo ":global-test-result:SKIP${tab} ${tab}${tab}" > foo.test
163 echo ":global-test-result:${tab} ${tab}XFAIL ${tab} " > zar-doz.x
178 # Whitespaces before and after ':global-test-result:' are handled OK.
180 echo " $tab:global-test-result:PASS" > foo.test
181 echo "${tab}${tab}:global-test-result:${tab} ${tab}SKIP" > zar-doz.x