Merge branch 'yacc-quote-fix'
[automake.git] / tests / test-driver-acsubst.test
blob970a7b3d25af141206a27a406d25451d03f6a4d5
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 # parallel-tests:
18 # - LOG_DRIVER variables can be AC_SUBST'd
20 am_parallel_tests=yes
21 . ./defs || Exit 1
23 mkdir test-drivers
25 cp "$testsrcdir"/trivial-test-driver test-drivers/triv \
26 || fatal_ "failed to fetch auxiliary script trivial-test-driver"
27 cp "$am_scriptdir"/test-driver test-drivers/dflt \
28 || fatal_ "failed to fetch auxiliary script test-driver"
30 cat >> configure.in <<'END'
31 AC_SUBST([LOG_DRIVER], ['${SHELL} test-drivers/triv'])
32 AC_SUBST([TEST_LOG_DRIVER], ['${SHELL} test-drivers/dflt'])
33 AC_SUBST([SH_LOG_DRIVER], ['${my_drv}'])
34 AC_OUTPUT
35 END
37 cat > Makefile.am <<'END'
38 TEST_EXTENSIONS = .test .sh
39 my_drv = $(SHELL) test-drivers/dflt
40 TESTS = foo bar.test baz.sh
41 XFAIL_TESTS = baz.sh
42 .PHONY: check-autodefs
43 check-autodefs:
44 ### For debugging.
45 @echo LOG_DRIVER = $(LOG_DRIVER)
46 @echo TEST_LOG_DRIVER = $(TEST_LOG_DRIVER)
47 @echo SH_LOG_DRIVER = $(SH_LOG_DRIVER)
48 ### Checks here.
49 @echo ' ' $(LOG_DRIVER) ' ' | grep ' test-drivers/triv '
50 @echo ' ' $(TEST_LOG_DRIVER) ' ' | grep ' test-drivers/dflt '
51 @echo ' ' $(SH_LOG_DRIVER) ' ' | grep ' test-drivers/dflt '
52 END
54 $ACLOCAL
55 $AUTOMAKE
56 $AUTOCONF
58 ./configure
60 cat > foo <<'END'
61 #!/bin/sh
62 echo "PASS: from $0"
63 exit 1 # Exit status should be ignored by the trivial-test-driver.
64 END
66 cat > bar.test <<'END'
67 #!/bin/sh
68 exit 77
69 END
71 cat > baz.sh <<'END'
72 #!/bin/sh
73 exit 1
74 END
76 chmod a+x foo bar.test baz.sh
78 $MAKE check-autodefs
79 st=0; $MAKE check >stdout || st=$?
80 cat stdout
81 cat test-suite.log
82 cat foo.log
83 cat bar.log
84 cat baz.log
85 test $st -eq 0 || Exit 1
86 count_test_results total=3 pass=1 fail=0 skip=1 xfail=1 xpass=0 error=0