test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / conflnk.sh
1 #! /bin/sh
2 # Copyright (C) 2003-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 # Test to make sure links created by AC_CONFIG_LINKS get removed with
18 # 'make distclean'
19
20 . test-init.sh
21
22 echo 'SUBDIRS = sdir' > Makefile.am
23 : > src
24 mkdir sdir
25 : > sdir/Makefile.am
26 : > sdir/src2
27 mkdir sdir-no-make
28
29 cat >>configure.ac << 'EOF'
30 AC_CONFIG_FILES([sdir/Makefile])
31 AC_CONFIG_LINKS([dest:src])
32 AC_CONFIG_LINKS([dest2:src])
33 AC_CONFIG_LINKS([sdir/dest3:src])
34 AC_CONFIG_LINKS([dest4:sdir/src2])
35 AC_CONFIG_LINKS([sdir/dest5:sdir/src2 sdir-no-make/dest6:src])
36 AC_OUTPUT
37 EOF
38
39 $ACLOCAL
40 $AUTOMAKE
41 $AUTOCONF
42 ./configure
43
44 # Make sure nothing is deleted by 'make clean'
45 $MAKE clean
46
47 test -r dest
48 test -r dest2
49 test -r sdir/dest3
50 test -r dest4
51 test -r sdir/dest5
52 test -r sdir-no-make/dest6
53 test -f src
54 test -f sdir/src2
55
56 # Make sure the links are deleted by 'make distclean' and the original files
57 # are not.
58 $MAKE distclean
59
60 test -f src
61 test -f sdir/src2
62
63 test -r dest && exit 1
64 test -r dest2 && exit 1
65 test -r sdir/dest3 && exit 1
66 test -r dest4 && exit 1
67 test -r sdir/dest5 && exit 1
68 test -r sdir-no-make/dest6 && exit 1
69
70 :