Merge branch 'minor'
[automake.git] / t / check-subst.sh
blob35a989464efadbc27f04dda6501784fd2f70f42a
1 #! /bin/sh
2 # Copyright (C) 2008-2017 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 <https://www.gnu.org/licenses/>.
17 # Check @substituted@ TESTS.
18 # Note that in this test, we rely on the .test extension for the
19 # substituted names: this is necessary for the parallel harness.
20 # See also sister test 'check-subst-prog.sh'.
22 # For gen-testsuite-part: ==> try-with-serial-tests <==
23 . test-init.sh
25 cat >> configure.ac << 'END'
26 AC_SUBST([script_tests], ['subst-pass-script.sh subst-xfail-script.sh'])
27 AC_SUBST([xfail_tests], ['xfail-script.test subst-xfail-script.sh'])
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 TESTS = pass-script.test xfail-script.test @script_tests@
33 XFAIL_TESTS = @xfail_tests@
34 END
36 if test x"$am_serial_tests" != x"yes"; then
37 unindent >> Makefile.am <<'END'
38 TEST_EXTENSIONS = .sh .test
39 SH_LOG_COMPILER = $(SHELL)
40 END
43 cat > pass-script.test <<'END'
44 #! /bin/sh
45 exit 0
46 END
47 cat > xfail-script.test <<'END'
48 #! /bin/sh
49 exit 1
50 END
51 cp pass-script.test subst-pass-script.sh
52 cp xfail-script.test subst-xfail-script.sh
53 chmod a+x pass-script.test xfail-script.test
55 if test x"$am_serial_tests" = x"yes"; then
56 chmod a+x subst-pass-script.sh subst-xfail-script.sh
59 $ACLOCAL
60 $AUTOCONF
61 $AUTOMAKE -a
63 for vpath in false : ; do
65 if $vpath; then
66 mkdir build
67 cd build
68 srcdir=..
69 else
70 srcdir=.
73 $srcdir/configure
74 $MAKE all
75 $MAKE check
76 if test x"$am_serial_tests" != x"yes"; then
77 ls -l
78 test -f pass-script.log
79 test -f xfail-script.log
80 test -f subst-pass-script.log
81 test -f subst-xfail-script.log
83 $MAKE distclean
84 cd $srcdir
86 done