tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / parallel-tests-console-output.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 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 # parallel-tests: some checks on console output about testsuite
18 # progress.
19
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_OUTPUT
24 END
25
26 cat > Makefile.am << 'END'
27 XFAIL_TESTS = sub/xpass.test xfail.test error.test
28 TESTS = $(XFAIL_TESTS) fail.test pass.test a/b/skip.test sub/error2.test
29 pass.log: fail.log
30 error.log: pass.log
31 sub/xpass.log: error.log
32 sub/error2.log: xfail.log
33 a/b/skip.log: sub/error2.log
34 END
35
36 cat > exp <<'END'
37 FAIL: fail.test
38 PASS: pass.test
39 ERROR: error.test
40 XPASS: sub/xpass.test
41 XFAIL: xfail.test
42 ERROR: sub/error2.test
43 SKIP: a/b/skip.test
44 END
45
46 mkdir sub a a/b
47
48 cat > pass.test << 'END'
49 #!/bin/sh
50 exit 0
51 END
52 cp pass.test sub/xpass.test
53
54 cat > fail.test << 'END'
55 #!/bin/sh
56 exit 1
57 END
58
59 cat > xfail.test << 'END'
60 #!/bin/sh
61 # The sleep should ensure expected execution order of tests
62 # even when make is run in parallel mode.
63 # Creative quoting below to plase maintainer-check.
64 sleep '10'
65 exit 1
66 END
67
68 cat > error.test << 'END'
69 #!/bin/sh
70 exit 99
71 END
72 cp error.test sub/error2.test
73
74 cat > a/b/skip.test << 'END'
75 #!/bin/sh
76 exit 77
77 END
78
79 chmod a+x pass.test fail.test xfail.test sub/xpass.test \
80           a/b/skip.test error.test sub/error2.test
81
82 $ACLOCAL
83 $AUTOCONF
84 $AUTOMAKE -a
85
86 for vpath in : false; do
87   if $vpath; then
88     mkdir build
89     cd build
90     srcdir=..
91   else
92     srcdir=.
93   fi
94   $srcdir/configure
95   run_make -O -e FAIL check
96   LC_ALL=C grep '^[A-Z][A-Z]*:' stdout > got
97   cat got
98   diff $srcdir/exp got
99   cd $srcdir
100 done
101
102 :