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

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

automake 1.8.5

File size: 2.6 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002, 2003 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., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, 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
74cat >sub/scriptnok.sh <<EOF
75#!/bin/sh
76:
77EOF
78
79chmod +x sub/scriptok.sh
80chmod +x sub/scriptnok.sh
81
82# Files required by Gnits.
83: > INSTALL
84: > NEWS
85: > README
86: > COPYING
87: > AUTHORS
88: > ChangeLog
89: > THANKS
90
91# The following file should not be distributed.
92# (alpha.test checks the case where it must be distributed.)
93: > README-alpha
94
95set -e
96
97$ACLOCAL
98$AUTOCONF
99$AUTOMAKE -a
100
101grep README-alpha Makefile.in && exit 1
102
103mkdir build
104cd build
105
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.
111cat stderr
112$MAKE grep-stderr
Note: See TracBrowser for help on using the repository browser.