2 # Copyright (C) 2011 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 # Check parallel-tests features: DISABLE_HARD_ERRORS
24 cat >> configure.in << 'END'
25 AC_CONFIG_FILES([sub/Makefile])
31 cat > Makefile.am << 'END'
34 XFAIL_TESTS = foo.test
38 cat > sub/Makefile.am << 'END'
40 XFAIL_TESTS = $(TESTS)
44 cat > foo.test <<'END'
49 cp foo.test sub/bar.test
57 # DISABLE_HARD_ERRORS is not defined as a make variable, so that it
58 # should be possible to define either from the environment or from
59 # command-line, also when recursive make invocations are involved,
60 # and also without using the `-e' make flag; this should work also
61 # for non-GNU make. Moreover, it shouldn't be necessary to define
62 # DISABLE_HARD_ERRORS to "yes" to really disable hard errors: any
63 # non-empty value should do.
64 $MAKE check DISABLE_HARD_ERRORS=yes
65 DISABLE_HARD_ERRORS=x $MAKE check
67 # But an empty values for DISABLE_HARD_ERRORS means that hard errors
68 # are not to be counted like normal failures.
70 $MAKE check DISABLE_HARD_ERRORS='' && Exit 1
72 grep '^FAIL: foo\.test .*exit.*99' test-suite.log
75 # The `-e' is wanted here.
76 DISABLE_HARD_ERRORS='' $MAKE -e check && Exit 1
78 grep '^FAIL: bar\.test .*exit.*99' test-suite.log
81 # Check the distributions.
82 $MAKE DISABLE_HARD_ERRORS=y distcheck
84 # Finally, DISABLE_HARD_ERRORS should work also when the developer
85 # sets it directly in Makefile.am or Makefile. And its effects
86 # should remain local to that specific Makefile, obviously.
88 echo 'DISABLE_HARD_ERRORS = yes' >> Makefile.am
90 ./config.status Makefile
91 VERBOSE=yes $MAKE check && Exit 1
92 grep '^FAIL' test-suite.log && Exit 1
93 grep '^FAIL: bar\.test .*exit.*99' sub/test-suite.log
95 echo 'DISABLE_HARD_ERRORS = zardoz' >> sub/Makefile
96 VERBOSE=yes $MAKE check