am-ft: make the environment available earlier
[platform/upstream/automake.git] / t / parallel-tests-exeext.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # parallel-tests:
18 #   - check2.am and interaction with $(EXEEXT)
19
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 dnl We need to fool the init.m4 internals a little.
24 AC_DEFUN([_AM_FOO],
25   [m4_provide([_AM_COMPILER_EXEEXT])
26   AC_SUBST([CC], [false])
27   AC_SUBST([EXEEXT])])
28 _AM_FOO
29 AC_OUTPUT
30 END
31
32 cat > Makefile.am << 'END'
33 TESTS = x y a.test b.test
34 LOG_COMPILER = true
35 TEST_LOG_COMPILER = true
36 ## We also need to fool the automake internals a little.
37 EXTRA_PROGRAMS = y
38 y_SOURCES =
39 END
40
41 $ACLOCAL
42 $AUTOCONF
43 $AUTOMAKE -a
44
45 $EGREP 'EXEEXT|\.log|\.test' Makefile.in # For debugging.
46
47 ./configure EXEEXT=
48 touch x y a.test b.test
49 $MAKE check
50
51 $MAKE distclean
52 rm -f x y a.test b.test *.log *.trs
53
54 ./configure EXEEXT=.bin
55 touch x y.bin a.test b.test.bin
56 $MAKE check
57 ls -l # For debugging.
58 test -f y.log
59 test ! -e y.bin.log
60 test -f b.log
61 test ! -e b.test.log
62
63 $EGREP '^y\.log: y(\$\(EXEEXT\)|\.bin)' Makefile
64 $EGREP '^\.test(\$\(EXEEXT\)|\.bin)\.log:' Makefile
65
66 :