tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / parallel-tests-harderror.sh
1 #! /bin/sh
2 # Copyright (C) 2011-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 parallel-tests features: DISABLE_HARD_ERRORS
18
19 am_parallel_tests=yes
20 . ./defs || Exit 1
21
22 cat >> configure.ac << 'END'
23 AC_CONFIG_FILES([sub/Makefile])
24 AC_OUTPUT
25 END
26
27 mkdir sub
28
29 cat > Makefile.am << 'END'
30 SUBDIRS = . sub
31 TESTS = foo.test
32 XFAIL_TESTS = foo.test
33 EXTRA_DIST = $(TESTS)
34 END
35
36 cat > sub/Makefile.am << 'END'
37 TESTS = bar.test
38 XFAIL_TESTS = $(TESTS)
39 EXTRA_DIST = $(TESTS)
40 END
41
42 cat > foo.test <<'END'
43 #! /bin/sh
44 exit 99
45 END
46 chmod a+x foo.test
47 cp foo.test sub/bar.test
48
49 $ACLOCAL
50 $AUTOCONF
51 $AUTOMAKE -a
52
53 ./configure
54
55 # DISABLE_HARD_ERRORS is not defined as a make variable, so that it
56 # should be possible to define either from the environment or from
57 # command-line, also when recursive make invocations are involved,
58 # and also without using the '-e' make flag; this should work also
59 # for non-GNU make. Moreover, it shouldn't be necessary to define
60 # DISABLE_HARD_ERRORS to "yes" to really disable hard errors: any
61 # non-empty value should do.
62 $MAKE check DISABLE_HARD_ERRORS=yes
63 DISABLE_HARD_ERRORS=x $MAKE check
64
65 # But an empty values for DISABLE_HARD_ERRORS means that hard errors
66 # are not to be counted like normal failures.
67
68 $MAKE check DISABLE_HARD_ERRORS='' && Exit 1
69 cat test-suite.log
70 grep '^ERROR: foo$' test-suite.log
71
72 cd sub
73 # The '-e' is wanted here.
74 DISABLE_HARD_ERRORS='' $MAKE -e check && Exit 1
75 cat test-suite.log
76 grep '^ERROR: bar$' test-suite.log
77 cd ..
78
79 # Check the distributions.
80 $MAKE DISABLE_HARD_ERRORS=y distcheck
81
82 # Finally, DISABLE_HARD_ERRORS should work also when the developer
83 # sets it directly in Makefile.am or Makefile.  And its effects
84 # should remain local to that specific Makefile, obviously.
85
86 echo 'DISABLE_HARD_ERRORS = yes' >> Makefile.am
87 $AUTOMAKE Makefile
88 ./config.status Makefile
89 VERBOSE=yes $MAKE check && Exit 1
90 grep '^FAIL' test-suite.log && Exit 1
91 grep '^ERROR: bar$' sub/test-suite.log
92
93 echo 'DISABLE_HARD_ERRORS = zardoz' >> sub/Makefile
94 VERBOSE=yes $MAKE check
95
96 :