tests: avoid two spurious failures on FreeBSD
[automake.git] / t / strictness-precedence.sh
blobab70ee3fd008508464d33cc8a11e18dd8e567d82
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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 <http://www.gnu.org/licenses/>.
17 # On the command line, in AM_INIT_AUTOMAKE, and in AUTOMAKE_OPTIONS,
18 # strictness specified later should take precedence over strictness
19 # specified earlier.
21 . ./defs || exit 1
23 # We want complete control over automake options.
24 AUTOMAKE=$am_original_AUTOMAKE
26 cat > Makefile.am <<'END'
27 AUTOMAKE_OPTIONS =
28 END
30 set_strictness ()
32 set +x
33 sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
34 -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
35 mv -f $2-t $2
36 set -x
37 cat $2
40 ok ()
42 $AUTOMAKE -Werror $*
45 ko ()
47 AUTOMAKE_fails $*
48 grep 'required file.*README' stderr
51 # Leave out only one of the required files, to avoid too much
52 # repetition in the error messages.
53 touch INSTALL NEWS AUTHORS ChangeLog COPYING
55 $ACLOCAL
56 ko --foreign --gnu
57 ok --gnu --foreign
59 set_strictness '' Makefile.am
60 set_strictness 'gnu foreign' configure.ac
61 rm -rf autom4te*.cache
62 $ACLOCAL
64 set_strictness 'foreign gnu' configure.ac
65 rm -rf autom4te*.cache
66 $ACLOCAL
69 set_strictness '' configure.ac
70 rm -rf autom4te*.cache
71 $ACLOCAL
72 set_strictness 'gnu foreign' Makefile.am
74 set_strictness 'foreign gnu' Makefile.am