tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / colon2.sh
1 #! /bin/sh
2 # Copyright (C) 1996-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 # Make sure ":" works with files automake generates.
18 # See also sister test 'colon3.sh'.
19
20 . test-init.sh
21
22 cat > configure.ac <<END
23 AC_INIT([$me], [1.0])
24 AM_INIT_AUTOMAKE
25 AC_CONFIG_FILES([Makefile:zardoz.in])
26 AC_OUTPUT
27 END
28
29 cat > zardoz.am <<END
30 .PHONY: dummy
31 dummy:
32 END
33
34 $ACLOCAL
35 $AUTOMAKE
36
37 # Automake should have created zardoz.in.
38 test -f zardoz.in
39
40 # The generated file should refer to zardoz.in and zardoz.am, but
41 # never just "zardoz".
42 $FGREP 'zardoz.am' zardoz.in
43 $FGREP 'zardoz.in' zardoz.in
44 sed -e 's|zardoz\.am|zrdz.am|g' \
45     -e 's|zardoz\.in|zrdz.in|g' \
46   <zardoz.in | $FGREP 'zardoz' && exit 1
47
48 # The configure-generated Makefile should depend on zardoz.in, two.in and
49 # three.in.  The automake-generated zardoz.in should depend on zardoz.am.
50 # Let's do this check the right way by running configure and make.
51
52 str='%% ZaR DoZ %%'
53
54 $AUTOCONF
55 ./configure
56 test -f Makefile # Sanity check.
57
58 $MAKE dummy
59 # Again, make sure that the generated Makefile do not unduly
60 # refer to 'zardoz' .
61 $MAKE -n zardoz && exit 1
62
63 $sleep
64 cat >> zardoz.am <<END
65 check-local: testam testin testmk
66 .PHONY: testam testin testmk
67 testam:
68         grep '$str' \$(srcdir)/zardoz.am
69 testin:
70         grep '$str' \$(srcdir)/zardoz.in
71 testmk:
72         grep '$str' Makefile
73 END
74 $MAKE Makefile # For non-GNU make.
75 $MAKE testam testin testmk
76
77 $MAKE distcheck
78
79 :