test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / nobase-nodist.sh
1 #! /bin/sh
2 # Copyright (C) 2011-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 # Interaction of 'nobase_' and 'nodist_' prefixes.
18
19 . test-init.sh
20
21 # Simulate no emacs and no python (it shouldn't be needed in this test).
22 EMACS="no" PYTHON=":"; export EMCAS PYTHON
23
24 cat >> configure.ac << 'END'
25 AM_PATH_LISPDIR
26 AM_PATH_PYTHON([], [], [:])
27 # Simulate no javac (it shouldn't be needed in this test).
28 AC_SUBST([JAVAC], [false])
29 AC_OUTPUT
30 END
31
32 cat > Makefile.am << 'END'
33 nobase_nodist_noinst_PYTHON = baz1.py sub/baz2.py
34 # Lisp and Java sources are not distributed by default, so try both
35 # with and without the 'nodist_' prefix, for more coverage.
36 nobase_noinst_LISP = foo1.el sub/foo2.el
37 nobase_nodist_noinst_LISP = foo3.el sub/foo4.el
38 nobase_noinst_JAVA = bar1.java sub/bar2.java
39 nobase_nodist_noinst_JAVA = bar3.java sub/bar4.java
40 END
41
42 $ACLOCAL
43 $AUTOCONF
44 $AUTOMAKE -a
45 ./configure
46 $MAKE distdir
47
48 ls -l $distdir $distdir/* # For debugging.
49 test ! -e $distdir/foo1.el
50 test ! -e $distdir/sub/foo2.el
51 test ! -e $distdir/foo3.el
52 test ! -e $distdir/sub/foo4.el
53 test ! -e $distdir/bar1.java
54 test ! -e $distdir/sub/bar2.java
55 test ! -e $distdir/bar3.java
56 test ! -e $distdir/sub/bar4.java
57 test ! -e $distdir/baz1.py
58 test ! -e $distdir/sub/baz2.py
59
60 :