tests: expose automake bug#14560
[platform/upstream/automake.git] / t / colon5.sh
1 #! /bin/sh
2 # Copyright (C) 1998-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 # Another multi-":" test, this time from Doug Evans.
18
19 . test-init.sh
20
21 cat > configure.ac <<END
22 AC_INIT([$me], [1.0])
23 AM_INIT_AUTOMAKE
24 AC_CONFIG_FILES([Makefile:Makefile.in:Makefile.dep])
25 AC_OUTPUT
26 END
27
28 : > Makefile.dep
29
30 cat > Makefile.am <<'END'
31 .PHONY: test-fs-layout test-grep test-distcommon test-distdir
32 check-local: test-fs-layout test-grep test-distcommon test-distdir
33 test-fs-layout:
34         test x'$(srcdir)' = '.' || test ! -r Makefile.dep
35 test-grep:
36 ## The use of $(empty) prevents spurious matches.
37         grep '=GrEp$(empty)Me_am=' $(srcdir)/Makefile.in
38         grep '=GrEp$(empty)Me_dep=' $(srcdir)/Makefile.dep
39         grep '=GrEp$(empty)Me_am=' Makefile
40         grep '=GrEp$(empty)Me_dep=' Makefile
41 test-distcommon:
42         echo ' ' $(DIST_COMMON) ' ' | grep '[ /]Makefile.dep '
43 test-distdir: distdir
44         test -f $(distdir)/Makefile.dep
45 END
46
47 $ACLOCAL
48 $AUTOCONF
49 $AUTOMAKE
50
51 ./configure
52
53 grep '=GrEpMe_am=' Makefile && exit 1  # Sanity check.
54 grep '=GrEpMe_dep=' Makefile && exit 1 # Likewise.
55
56 $MAKE test-distcommon
57 $MAKE test-distdir
58
59 $sleep
60
61 echo '# =GrEpMe_am=' >> Makefile.am
62 echo '# =GrEpMe_dep=' >> Makefile.dep
63
64 $MAKE Makefile # For non-GNU make.
65 $MAKE test-grep
66 $MAKE test-distcommon
67 $MAKE test-distdir
68
69 $MAKE distcheck
70
71 :