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/>.
17 # Parallel testsuite harness: check APIs for the registering the
18 # "global test result" in '*.trs' files, as documented in the automake
23 cat >> configure.ac
<< 'END'
27 cat > Makefile.am
<< 'END'
28 TEST_EXTENSIONS
= .
test .x
29 TEST_LOG_DRIVER
= .
/dummy-driver
30 X_LOG_DRIVER
= .
/dummy-driver
31 TESTS
= foo.
test zar-doz.
test
34 cat > dummy-driver
<<'END'
37 while test $# -gt 0; do
39 --log-file) log_file=$2; shift;;
40 --trs-file) trs_file=$2; shift;;
41 --test-name) test_name=$2; shift;;
42 --expect-failure|--color-tests|--enable-hard-errors) shift;;
44 *) echo "$0: invalid option/argument: '$1'" >&2; exit 2;;
48 echo logloglog > $log_file
51 chmod a
+x dummy-driver
53 # Do this in a subroutine to avoid quoting problem in the backticked
54 # command substitution below.
57 sed -e 's,[$^/\\\.],\\&,g' -e 1q
"$@"
62 cat > exp
; echo >> exp
; echo logloglog
>> exp
63 eline
=$
(get_escaped_line exp
)
64 sed -n -e "/^$eline$/,/^logloglog$/p" test-suite.log
> got
77 echo :global-test-result
: PASS
> foo.
test
78 echo :global-test-result
: ERROR
> zar-doz.x
93 : Try usage documented
in the manual.
95 echo :global-test-result
: PASS
/SKIP
> foo.
test
96 echo :global-test-result
: ALMOST PASSED
> zar-doz.x
107 ALMOST PASSED: zar-doz
108 ======================
111 : Fields
':test-result:' does not interfere with the global
test result.
113 cat > foo.
test << 'END'
115 :global-test-result
: PASS
119 cat > zar-doz.x
<< 'END'
120 :global-test-result
: FAIL
125 $MAKE check
&& exit 1
138 : What happens when
':global-test-result:' is absent.
140 cat > foo.
test << 'END'
146 $MAKE check
&& exit 1
159 # Leading and trailing whitespace gets eaten/normalized.
161 echo ":global-test-result:SKIP${tab} ${tab}${tab}" > foo.
test
162 echo ":global-test-result:${tab} ${tab}XFAIL ${tab} " > zar-doz.x
177 # Whitespaces before and after ':global-test-result:' are handled OK.
179 echo " $tab:global-test-result:PASS" > foo.
test
180 echo "${tab}${tab}:global-test-result:${tab} ${tab}SKIP" > zar-doz.x