Merge branch 'yacc-quote-fix'
[automake.git] / tests / test-driver-fail.test
bloba9359da9aecd327ffd202658aee77617489c6f64
1 #! /bin/sh
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)
7 # any later version.
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 # Custom test drivers: what happens when a test driver fails? Well,
18 # "make check" should at least fail too, and the test-suite.log
19 # shouldn't be created. Unfortunately, we cannot truly control also
20 # the (non-)creation of individual test logs, since those are expected
21 # to be created by the drivers themselves, and an ill-behaved driver
22 # (like our dummy one in this test) might leave around a test log even
23 # in case of internal failures.
25 am_parallel_tests=yes
26 . ./defs || Exit 1
28 cat >> configure.in <<'END'
29 AC_OUTPUT
30 END
32 cat > Makefile.am <<'END'
33 TEST_LOG_DRIVER = ./oops
34 TESTS = foo.test
35 END
37 cat > foo.test <<'END'
38 #! /bin/sh
39 exit 0
40 END
42 $ACLOCAL
43 $AUTOCONF
44 $AUTOMAKE
46 ./configure
48 # The testsuite driver does not exist.
49 $MAKE check && Exit 1
50 test ! -f test-suite.log
52 # The testsuite driver exists and create the test log files, but fails.
54 cat > oops <<'END'
55 #!/bin/sh
56 : > foo.log
57 echo 'Oops, I fail!' >&2
58 exit 1
59 END
60 chmod a+x oops
62 $MAKE check && Exit 1
63 test ! -f test-suite.log