test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / stamph2.sh
1 #! /bin/sh
2 # Copyright (C) 2001-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 stamp-h* files are created where we expect
18 . test-init.sh
19
20 cat >> configure.ac << END
21 AC_CONFIG_HEADERS([1.h
22                    2.h:config.hin
23                    3.h:sdir1/config1.hin])
24 AC_CONFIG_HEADERS([sdir1/4.h
25                    sdir1/5.h:config.hin
26                    sdir1/6.h:sdir1/config1.hin
27                    sdir1/7.h:sdir2/config2.hin])
28 AC_OUTPUT
29 END
30
31 : > Makefile.am
32 mkdir sdir1
33 mkdir sdir2
34 : > config.hin
35 : > 1.h.in
36 : > sdir1/4.h.in
37 : > sdir1/config1.hin
38 : > sdir2/config2.hin
39
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE
43 ./configure
44
45 test -f stamp-h1
46 test -f stamp-h2
47 test -f stamp-h3
48 test -f sdir1/stamp-h4
49 test -f sdir1/stamp-h5
50 test -f sdir1/stamp-h6
51 test -f sdir1/stamp-h7
52
53 # Make sure './config.status foo' creates the right stamp file.
54 # Report from Sander Niemeijer.
55
56 rm -f stamp-h*
57 rm -f sdir1/stamp-h*
58
59 ./config.status sdir1/7.h 2.h sdir1/4.h
60 test ! -e stamp-h1
61 test -f stamp-h2
62 test ! -e stamp-h3
63 test -f sdir1/stamp-h4
64 test ! -e sdir1/stamp-h5
65 test ! -e sdir1/stamp-h6
66 test -f sdir1/stamp-h7
67
68 :