tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / remake10b.sh
1 #! /bin/sh
2 # Copyright (C) 2010-2012 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 # Test remake rules for am files included (also recursively) by
18 # Makefile.am.
19 # Keep in sync with sister tests 'remake10a.test' and 'remake10c.test'.
20
21 . ./defs || Exit 1
22
23 magic1=::MagicStringOne::
24 magic2=__MagicStringTwo__
25 magic3=%%MagicStringThree%%
26
27 if using_gmake; then
28   remake="$MAKE nil"
29 else
30   remake="$MAKE Makefile"
31 fi
32
33 cat >> configure.ac <<'END'
34 AC_OUTPUT
35 END
36
37 cat > Makefile.am <<'END'
38 .PHONY: nil
39 nil:
40 include foo.am
41 ## Used by "make distcheck" later.
42 check-local:
43         test -f $(top_srcdir)/foo.am
44         test ! -r $(top_srcdir)/bar.am
45         test x'$(FINGERPRINT)' = x'DummyValue'
46 END
47
48 echo 'FINGERPRINT = BadBadBad' > foo.am
49
50 $ACLOCAL
51 $AUTOCONF
52 $AUTOMAKE
53
54 for vpath in : false; do
55
56   if $vpath; then
57     mkdir build
58     cd build
59     top_srcdir=..
60   else
61     top_srcdir=.
62   fi
63
64   $top_srcdir/configure
65   $MAKE # Should be a no-op.
66
67   $sleep
68   echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
69   $remake
70   $FGREP FINGERPRINT Makefile # For debugging.
71   $FGREP $magic1 Makefile
72
73   $sleep
74   echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
75   $remake
76   $FGREP FINGERPRINT Makefile # For debugging.
77   $FGREP $magic1 Makefile && Exit 1
78   $FGREP $magic2 Makefile
79
80   $sleep
81   echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
82   echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
83   $remake
84   $FGREP FINGERPRINT Makefile # For debugging.
85   $FGREP $magic1 Makefile && Exit 1
86   $FGREP $magic2 Makefile && Exit 1
87   $FGREP $magic3 Makefile
88
89   $sleep
90   echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
91   $remake
92   $FGREP $magic2 Makefile && Exit 1
93   $FGREP $magic3 Makefile && Exit 1
94   $FGREP $magic1 Makefile
95
96   $sleep
97   echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
98   using_gmake || $remake
99   $MAKE distcheck
100   $FGREP $magic1 Makefile && Exit 1 # Sanity check.
101   $FGREP $magic2 Makefile && Exit 1 # Likewise.
102   $FGREP $magic3 Makefile && Exit 1 # Likewise.
103
104   $MAKE distclean
105
106   cd $top_srcdir
107
108 done
109
110 :