source: trunk/essentials/sys-devel/automake-1.9/tests/gnits2.test

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 2.7 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
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.
10#
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.
15#
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., 51 Franklin Street, Fifth Floor,
19# Boston, MA 02110-1301, USA.
20
21# Test to ensure std-options checking is correct.
22
23required=gcc
24. ./defs || exit 1
25
26cat >> configure.in << 'END'
27AC_PROG_CC
28AC_OUTPUT
29END
30
31cat > Makefile.am << 'END'
32AUTOMAKE_OPTIONS = gnits
33noinst_PROGRAMS = fubar2
34bin_PROGRAMS = fubar sub/fine
35nobase_bin_PROGRAMS = sub/fubar3
36fubar_SOURCES = fubar.c
37fubar2_SOURCES = fubar.c
38sub_fubar3_SOURCES = fubar.c
39sub_fine_SOURCES = fine.c
40bin_SCRIPTS = sub/scriptok.sh sub/scriptnok.sh
41
42grep-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
49
50test-install: install
51 test -f ../inst-dir/bin/pfine$(EXEEXT)
52 test ! -f ../inst-dir/bin/fine$(EXEEXT)
53END
54
55echo 'int main () { return 0; }' > fubar.c
56
57cat > fine.c << 'END'
58#include <stdio.h>
59int
60main ()
61{
62 puts ("Which version? Which usage?");
63 return 0;
64}
65END
66
67mkdir sub
68
69cat >sub/scriptok.sh <<EOF
70#!/bin/sh
71echo "Which version? Which usage?"
72EOF
73
74# Not only does this script not support --help/--version, but
75# it will also hang when run without input.
76cat >sub/scriptnok.sh <<EOF
77#!/bin/sh
78cat
79EOF
80
81chmod +x sub/scriptok.sh
82chmod +x sub/scriptnok.sh
83
84# Files required by Gnits.
85: > INSTALL
86: > NEWS
87: > README
88: > COPYING
89: > AUTHORS
90: > ChangeLog
91: > THANKS
92
93# The following file should not be distributed.
94# (alpha.test checks the case where it must be distributed.)
95: > README-alpha
96
97set -e
98
99$ACLOCAL
100$AUTOCONF
101$AUTOMAKE -a
102
103grep README-alpha Makefile.in && exit 1
104
105mkdir build
106cd build
107
108# Use --program-prefix to make sure the std-options check honors it.
109../configure --prefix=`pwd`/../inst-dir --program-prefix=p
110$MAKE all
111$MAKE test-install
112$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
113cat stderr
114$MAKE grep-stderr
Note: See TracBrowser for help on using the repository browser.