* doc/automake.texi (Future of aclocal): Make clearer that
[automake.git] / tests / gnits2.test
blob91a2c3d2d813c8d43dff87295709a031f111f9bc
1 #! /bin/sh
2 # Copyright (C) 2002, 2003 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., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # Test to ensure std-options checking is correct.
23 required=gcc
24 . ./defs || exit 1
26 cat >> configure.in << 'END'
27 AC_PROG_CC
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 AUTOMAKE_OPTIONS = gnits
33 noinst_PROGRAMS = fubar2
34 bin_PROGRAMS = fubar sub/fine
35 nobase_bin_PROGRAMS = sub/fubar3
36 fubar_SOURCES = fubar.c
37 fubar2_SOURCES = fubar.c
38 sub_fubar3_SOURCES = fubar.c
39 sub_fine_SOURCES = fine.c
40 bin_SCRIPTS = sub/scriptok.sh sub/scriptnok.sh
42 grep-stderr:
43 grep 'pfubar$(EXEEXT) does not support' stderr
44 grep 'pfubar3$(EXEEXT) does not support' stderr
45 grep 'pscriptnok.sh does not support' stderr
46 ## Only three failures please.
47 test `grep 'does not support --help' stderr | wc -l` = 3
48 test `grep 'does not support --version' stderr | wc -l` = 3
50 test-install: install
51 test -f ../inst-dir/bin/pfine$(EXEEXT)
52 test ! -f ../inst-dir/bin/fine$(EXEEXT)
53 END
55 echo 'int main () { return 0; }' > fubar.c
57 cat > fine.c << 'END'
58 #include <stdio.h>
59 int
60 main ()
62 puts ("Which version? Which usage?");
63 return 0;
65 END
67 mkdir sub
69 cat >sub/scriptok.sh <<EOF
70 #!/bin/sh
71 echo "Which version? Which usage?"
72 EOF
74 cat >sub/scriptnok.sh <<EOF
75 #!/bin/sh
77 EOF
79 chmod +x sub/scriptok.sh
80 chmod +x sub/scriptnok.sh
82 # Files required by Gnits.
83 : > INSTALL
84 : > NEWS
85 : > README
86 : > COPYING
87 : > AUTHORS
88 : > ChangeLog
89 : > THANKS
91 # The following file should not be distributed.
92 # (alpha.test checks the case where it must be distributed.)
93 : > README-alpha
95 set -e
97 $ACLOCAL
98 $AUTOCONF
99 $AUTOMAKE -a
101 grep README-alpha Makefile.in && exit 1
103 mkdir build
104 cd build
106 # Use --program-prefix to make sure the std-options check honors it.
107 ../configure --prefix=`pwd`/../inst-dir --program-prefix=p
108 $MAKE all
109 $MAKE test-install
110 $MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
111 cat stderr
112 $MAKE grep-stderr