2 # Copyright (C) 2011-2024 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 <https://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 $MAKE check DISABLE_HARD_ERRORS
= && exit 1
74 grep '^ERROR: bar$' test-suite.log
77 # Check the distributions.
78 $MAKE DISABLE_HARD_ERRORS
=y distcheck
80 # Finally, DISABLE_HARD_ERRORS should work also when the developer
81 # sets it directly in Makefile.am or Makefile. And its effects
82 # should remain local to that specific Makefile, obviously.
84 echo 'DISABLE_HARD_ERRORS = yes' >> Makefile.am
86 .
/config.status Makefile
87 VERBOSE
=yes $MAKE check
&& exit 1
88 grep '^FAIL' test-suite.log
&& exit 1
89 grep '^ERROR: bar$' sub
/test-suite.log
91 echo 'DISABLE_HARD_ERRORS = zardoz' >> sub
/Makefile
92 VERBOSE
=yes $MAKE check