doc: typos in test file.
[automake.git] / t / strictness-override.sh
blob62665a590f4fd590453277b218e9a56b8d1466e9
1 #! /bin/sh
2 # Copyright (C) 2011-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 # The strictness specified in Makefile.am:AUTOMAKE_OPTIONS should
18 # override that specified in configure.ac:AM_INIT_AUTOMAKE, and both
19 # should override the strictness specified on the command line.
20 # NOTE: the current semantics might not be the best one (even if it has
21 # been in place for quite a long time); see also Automake bug #7673.
22 # Update this test if the semantics are changed.
24 . test-init.sh
26 # We want complete control over automake options.
27 AUTOMAKE=$am_original_AUTOMAKE
29 cat > Makefile.am <<'END'
30 AUTOMAKE_OPTIONS =
31 END
33 set_strictness ()
35 set +x
36 sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
37 -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
38 mv -f $2-t $2
39 set -x
40 cat $2
43 ok ()
45 $AUTOMAKE -Werror $*
48 ko ()
50 AUTOMAKE_fails $*
51 grep 'required file.*README' stderr
54 $ACLOCAL
56 # Leave out only one of the required files, to avoid too much
57 # repetition in the error messages.
58 touch INSTALL NEWS AUTHORS ChangeLog COPYING
60 rm -rf autom4te*.cache
61 set_strictness '' Makefile.am
62 set_strictness '' configure.ac
63 ko --gnu
65 ok --foreign
67 rm -rf autom4te*.cache
68 set_strictness 'gnu' Makefile.am
69 set_strictness '' configure.ac
70 ko --gnu
72 ko --foreign
74 rm -rf autom4te*.cache
75 set_strictness '' Makefile.am
76 set_strictness 'gnu' configure.ac
77 ko --gnu
79 ko --foreign
81 rm -rf autom4te*.cache
82 set_strictness 'foreign' Makefile.am
83 set_strictness '' configure.ac
84 ok --gnu
86 ok --foreign
88 rm -rf autom4te*.cache
89 set_strictness '' Makefile.am
90 set_strictness 'foreign' configure.ac
91 ok --gnu
93 ok --foreign
95 rm -rf autom4te*.cache
96 set_strictness 'gnu' Makefile.am
97 set_strictness 'gnu' configure.ac
98 ko --gnu
100 ko --foreign
102 rm -rf autom4te*.cache
103 set_strictness 'foreign' Makefile.am
104 set_strictness 'foreign' configure.ac
105 ok --gnu
107 ok --foreign
109 rm -rf autom4te*.cache
110 set_strictness 'foreign' Makefile.am
111 set_strictness 'gnu' configure.ac
112 ok --gnu
114 ok --foreign
116 rm -rf autom4te*.cache
117 set_strictness 'gnu' Makefile.am
118 set_strictness 'foreign' configure.ac
119 ko --gnu
121 ko --foreign