* lib/Automake/Variable.pm (_hash_varname, _hash_values): New functions.
[automake.git] / tests / check2.test
blob86ccef0f4b417697a3f7917248f6a9e541c2f1d3
1 #! /bin/sh
2 # Copyright (C) 2002, 2006 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
21 # Test Automake style tests.
23 . ./defs || exit 1
25 set -e
27 cat >> configure.in << 'END'
28 AC_CONFIG_FILES([dir/Makefile])
29 AC_OUTPUT
30 END
32 mkdir dir
34 cat > Makefile.am << 'END'
35 SUBDIRS = dir
36 TESTS = \
37 subrun.sh
38 subrun.sh:
39 (echo '#! /bin/sh'; echo 'dir/echo.sh') > $@
40 chmod +x $@
41 CLEANFILES = subrun.sh
42 END
44 cat > dir/Makefile.am << 'END'
45 check_SCRIPTS = echo.sh
46 echo.sh:
47 (echo '#! /bin/sh'; echo 'echo Hello') > $@
48 chmod +x $@
49 CLEANFILES = echo.sh
50 END
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE
55 ./configure
56 $MAKE check >stdout
57 cat stdout
58 grep 'PASS: subrun.sh' stdout
60 # check should depend directly on check-am (similar tests are
61 # in check.test and check3.test).
62 grep 'check: check-recursive' Makefile.in
63 grep 'check: check-am' dir/Makefile.in
65 # Make sure subrun.sh is still on its line as above. This means Automake
66 # hasn't rewritten the TESTS line unnecessarily (we can tell, because all
67 # Automake variables are reformatted by VAR_PRETTY).
68 grep ' subrun.sh' Makefile.in