test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / extra-dist-wildcards.sh
1 #! /bin/sh
2 # Copyright (C) 2010-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 # Check that wildcards in EXTRA_DIST are honoured.
18 # Suggested by observations from Braden McDaniel.
19 # See also sister test 'extra-dist-wildcards-gnu.sh', that checks a
20 # similar usage with the involvement of the $(wildcard) GNU make builtin.
21
22 required=GNUmake
23 . test-init.sh
24
25 echo AC_OUTPUT >> configure.ac
26
27 cat > Makefile.am <<'END'
28 EXTRA_DIST = *.foo
29 .PHONY: test
30 test: distdir
31         diff a.foo $(distdir)/a.foo
32         diff b.foo $(distdir)/b.foo
33         test ! -r $(distdir)/c.bar
34 check-local:
35         test -f $(srcdir)/a.foo
36         test -f $(srcdir)/b.foo
37         test ! -r $(srcdir)/c.bar
38 END
39
40 $ACLOCAL
41 $AUTOMAKE
42 $AUTOCONF
43
44 echo aaa > a.foo
45 echo bbb > b.foo
46 echo ccc > c.bar
47 ./configure
48 $MAKE test
49
50 :