doc: update Vala documentation
[automake.git] / t / gnits3.sh
blob51532a51ae0fab59a397ad3bab0a86b34df27d68
1 #! /bin/sh
2 # Copyright (C) 2002-2024 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Check that AM_INSTALLCHECK_STD_OPTIONS_EXEMPT works.
19 required=cc
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AC_OUTPUT
25 END
27 # We use the same basename for all targets on purpose. This way
28 # we make sure that 'AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok'
29 # will not match anything containing 'nok'.
30 cat > Makefile.am << 'END'
31 AUTOMAKE_OPTIONS = gnits
33 nobase_bin_PROGRAMS = nok sub/nok
34 nok_SOURCES = nok.c
35 sub_nok_SOURCES = nok.c
37 nobase_bin_SCRIPTS = nok.sh sub/nok.sh
39 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = nok$(EXEEXT) nok.sh
41 grep-stderr:
42 grep 'sub/pnok$(EXEEXT) does not support' stderr
43 grep 'sub/pnok\.sh does not support' stderr
44 ## Only two failures please.
45 test `grep 'does not support --help' stderr | wc -l` = 2
46 test `grep 'does not support --version' stderr | wc -l` = 2
47 END
49 cat > nok.c <<'END'
50 int main (void)
52 return 0;
54 END
56 mkdir sub
58 cat >nok.sh <<EOF
59 #!/bin/sh
60 echo "Which version? Which usage?"
61 exit 1
62 EOF
64 cp nok.sh sub/nok.sh
66 chmod +x nok.sh
67 chmod +x sub/nok.sh
69 # Files required by Gnits.
70 : > INSTALL
71 : > NEWS
72 : > README
73 : > COPYING
74 : > AUTHORS
75 : > ChangeLog
76 : > THANKS
78 $ACLOCAL
79 $AUTOCONF
80 $AUTOMAKE -a
82 mkdir build
83 cd build
85 # Use --program-prefix to make sure the std-options check honors it.
86 ../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
87 $MAKE
88 $MAKE install
89 $MAKE installcheck && exit 1
90 # Don't trust th exit status of "make -k" for non-GNU makes.
91 if using_gmake; then status=FAIL; else status=IGNORE; fi
92 run_make -e $status -E -- -k installcheck
93 $MAKE grep-stderr
95 # Make sure there is no more error when all targets are exempted.
96 cd ..
97 cat >> Makefile.am <<'END'
98 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += sub/nok$(EXEEXT) sub/nok.sh
99 END
100 $AUTOMAKE
101 cd build
102 ./config.status # Don't rely on the rebuild rules (they need GNU make).
103 $MAKE installcheck