~ubuntu-branches/ubuntu/precise/automake1.11/precise-proposed

« back to all changes in this revision

Viewing changes to tests/check3.test

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-08-12 02:36:44 UTC
  • Revision ID: james.westby@ubuntu.com-20090812023644-f40we9eqbmx1dpbj
Tags: upstream-1.11
ImportĀ upstreamĀ versionĀ 1.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# Copyright (C) 2002, 2003, 2007  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 `check:' and `install:' honor $(BUILT_SOURCES).
 
18
# PR/359.
 
19
 
 
20
. ./defs || Exit 1
 
21
 
 
22
set -e
 
23
 
 
24
cat >> configure.in << 'END'
 
25
AC_CONFIG_FILES([dir/Makefile])
 
26
AC_OUTPUT
 
27
END
 
28
 
 
29
mkdir dir
 
30
 
 
31
cat > Makefile.am << 'END'
 
32
BUILT_SOURCES = command1.inc
 
33
SUBDIRS = dir
 
34
TESTS = subrun.sh
 
35
subrun.sh:
 
36
        (echo '#! /bin/sh'; cat command1.inc) > $@
 
37
        chmod +x $@
 
38
command1.inc:
 
39
        echo 'dir/echo.sh' > $@
 
40
CLEANFILES = subrun.sh command1.inc
 
41
END
 
42
 
 
43
cat > dir/Makefile.am << 'END'
 
44
BUILT_SOURCES = command2.inc
 
45
check_SCRIPTS = echo.sh
 
46
echo.sh:
 
47
## The next line ensures that command1.inc has been built before
 
48
## recurring into the subdir.
 
49
        test -f ../command1.inc
 
50
        (echo '#! /bin/sh'; cat command2.inc) > $@
 
51
        chmod +x $@
 
52
command2.inc:
 
53
        echo 'echo Hello' > $@
 
54
CLEANFILES = echo.sh command2.inc
 
55
END
 
56
 
 
57
$ACLOCAL
 
58
$AUTOCONF
 
59
$AUTOMAKE
 
60
./configure --prefix "`pwd`/inst"
 
61
$MAKE check >stdout
 
62
cat stdout
 
63
grep 'PASS: subrun.sh' stdout
 
64
 
 
65
# check should depend directly on check-am (similar tests are
 
66
# in check.test and check2.test).
 
67
$FGREP 'check: $(BUILT_SOURCES)' Makefile.in
 
68
$FGREP 'check: $(BUILT_SOURCES)' dir/Makefile.in
 
69
 
 
70
$MAKE clean
 
71
# Sanity checks
 
72
test ! -f command1.inc
 
73
test ! -f dir/command2.inc
 
74
# Now make sure these two files are rebuilt during make install.
 
75
$MAKE install
 
76
test -f command1.inc
 
77
test -f dir/command2.inc