tests: fix a timestamp-related spurious failures
[automake.git] / tests / maintmode-configure-msg.test
blob5771392c8bea04284680262cfb624efd3fb10e58
1 #! /bin/sh
2 # Copyright (C) 2010, 2011 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 # Make sure that our macro `AM_MAINTAINER_MODE' adds proper text to
18 # the configure help screen. Also make sure the "checking ..." messages
19 # related to the enabling/disabling of maintainer mode are correct (see
20 # automake bug#9890).
22 . ./defs || Exit 1
24 set -e
26 set_maintmode ()
28 rm -rf autom4te*.cache # Just to be sure not to use a stale cache.
29 echo "AC_INIT([$me], [1.0])" > configure.in
30 case $1 in
31 DEFAULT) echo AM_MAINTAINER_MODE;;
32 *) echo "AM_MAINTAINER_MODE([$*])";;
33 esac >> configure.in
36 check_configure_message_with ()
38 answer=$1; shift
39 ./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; }
40 cat stdout
41 grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
42 test `grep -c 'checking.*maint' stdout` -eq 1
46 set_maintmode "DEFAULT"
48 $ACLOCAL
50 $AUTOCONF --force
52 ./configure --help >stdout || { cat stdout; Exit 1; }
53 cat stdout
54 grep '^ *--enable-maintainer-mode.* enable make rules' stdout
56 check_configure_message_with "no"
57 check_configure_message_with "yes" --enable-maintainer-mode
59 set_maintmode "disable"
61 $AUTOCONF --force
62 ./configure --help >stdout || { cat stdout; Exit 1; }
63 cat stdout
64 grep '^ *--enable-maintainer-mode.* enable make rules' stdout
66 check_configure_message_with "no"
67 check_configure_message_with "yes" --enable-maintainer-mode
69 set_maintmode "enable"
71 $AUTOCONF --force
72 ./configure --help >stdout || { cat stdout; Exit 1; }
73 cat stdout
74 grep '^ *--disable-maintainer-mode.* disable make rules' stdout
76 check_configure_message_with "yes"
77 check_configure_message_with "no" --disable-maintainer-mode