2 # Copyright (C) 2011-2012 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
21 cat >> configure.ac << 'END'
22 AC_CONFIG_FILES([sub/Makefile])
28 cat > Makefile.am << 'END'
31 XFAIL_TESTS = foo.test
35 cat > sub/Makefile.am << 'END'
37 XFAIL_TESTS = $(TESTS)
41 cat > foo.test <<'END'
46 cp foo.test sub/bar.test
54 # DISABLE_HARD_ERRORS is not defined as a make variable, so that it
55 # should be possible to define either from the environment or from
56 # command-line, also when recursive make invocations are involved,
57 # and also without using the '-e' make flag; this should work also
58 # for non-GNU make. Moreover, it shouldn't be necessary to define
59 # DISABLE_HARD_ERRORS to "yes" to really disable hard errors: any
60 # non-empty value should do.
61 $MAKE check DISABLE_HARD_ERRORS=yes
62 DISABLE_HARD_ERRORS=x $MAKE check
64 # But an empty values for DISABLE_HARD_ERRORS means that hard errors
65 # are not to be counted like normal failures.
67 $MAKE check DISABLE_HARD_ERRORS='' && exit 1
69 grep '^ERROR: foo$' test-suite.log
72 # The '-e' is wanted here.
73 DISABLE_HARD_ERRORS='' $MAKE -e check && exit 1
75 grep '^ERROR: bar$' test-suite.log
78 # Check the distributions.
79 $MAKE DISABLE_HARD_ERRORS=y distcheck
81 # Finally, DISABLE_HARD_ERRORS should work also when the developer
82 # sets it directly in Makefile.am or Makefile. And its effects
83 # should remain local to that specific Makefile, obviously.
85 echo 'DISABLE_HARD_ERRORS = yes' >> Makefile.am
87 ./config.status Makefile
88 VERBOSE=yes $MAKE check && exit 1
89 grep '^FAIL' test-suite.log && exit 1
90 grep '^ERROR: bar$' sub/test-suite.log
92 echo 'DISABLE_HARD_ERRORS = zardoz' >> sub/Makefile
93 VERBOSE=yes $MAKE check