maint: run "make update-copyright"
[platform/upstream/automake.git] / tests / parallel-tests-no-spurious-summary.test
1 #! /bin/sh
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Check that `:test-results:' directives in test scripts' output doesn't
18 # originate spurious results in the testsuite summary.
19
20 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 cat >> configure.in << 'END'
24 AC_OUTPUT
25 END
26
27 cat > Makefile.am << 'END'
28 TESTS = foo.test bar.test
29 END
30
31 cat > foo.test <<'END'
32 #! /bin/sh
33 echo :test-result:XFAIL
34 echo :test-result: SKIP
35 echo :test-result:ERROR
36 exit 0
37 END
38 cat > bar.test <<'END'
39 #! /bin/sh
40 echo :test-result: ERROR
41 echo :test-result:FAIL
42 echo :test-result: XPASS
43 exit 0
44 END
45 chmod a+x foo.test bar.test
46
47 $ACLOCAL
48 $AUTOCONF
49 $AUTOMAKE -a
50
51 ./configure
52
53 st=0
54 $MAKE check >stdout || st=$?
55 cat stdout
56 cat test-suite.log
57 cat foo.log
58 cat bar.log
59 test $st -eq 0 || Exit $st
60
61 grep '^:test-result:XFAIL$'  foo.log
62 grep '^:test-result: SKIP$'  foo.log
63 grep '^:test-result:FAIL$'   bar.log
64 grep '^:test-result: XPASS$' bar.log
65
66 count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
67
68 :