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

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

automake 1.8.5

File size: 2.4 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002 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# Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
22
23required=gcc
24. ./defs || exit 1
25
26cat >> configure.in << 'END'
27AC_PROG_CC
28AC_OUTPUT
29END
30
31# We use the same basename for all targets on purpose. This way
32# we make sure that `AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok'
33# will not match anything containing `nok'.
34cat > Makefile.am << 'END'
35AUTOMAKE_OPTIONS = gnits
36
37nobase_bin_PROGRAMS = nok sub/nok
38nok_SOURCES = nok.c
39sub_nok_SOURCES = nok.c
40
41nobase_bin_SCRIPTS = nok.sh sub/nok.sh
42
43AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok$(EXEEXT) nok.sh
44
45grep-stderr:
46 grep 'sub/pnok$(EXEEXT) does not support' stderr
47 grep 'sub/pnok.sh does not support' stderr
48## Only two failures please.
49 test `grep 'does not support --help' stderr | wc -l` = 2
50 test `grep 'does not support --version' stderr | wc -l` = 2
51END
52
53echo 'int main () { return 0; }' > nok.c
54
55mkdir sub
56
57cat >nok.sh <<EOF
58#!/bin/sh
59echo "Which version? Which usage?"
60exit 1
61EOF
62
63cp nok.sh sub/nok.sh
64
65chmod +x nok.sh
66chmod +x sub/nok.sh
67
68# Files required by Gnits.
69: > INSTALL
70: > NEWS
71: > README
72: > COPYING
73: > AUTHORS
74: > ChangeLog
75: > THANKS
76
77set -e
78
79$ACLOCAL
80$AUTOCONF
81$AUTOMAKE -a
82
83mkdir build
84cd build
85
86# Use --program-prefix to make sure the std-options check honors it.
87../configure --prefix=`pwd`/../inst-dir --program-prefix=p
88$MAKE
89$MAKE install
90$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
91cat stderr
92$MAKE grep-stderr
93
94# Make sure there is no more error when all targets are exempted.
95cd ..
96echo 'AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += sub/nok$(EXEEXT) sub/nok.sh' >> Makefile.am
97$AUTOMAKE
98cd build
99./config.status # Don't rely on the rebuild rules (they need GNU make).
100$MAKE installcheck
Note: See TracBrowser for help on using the repository browser.