tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / maintmode-configure-msg.sh
1 #! /bin/sh
2 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
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).
21
22 . ./defs || Exit 1
23
24 set_maintmode ()
25 {
26   rm -rf autom4te*.cache # Just to be sure not to use a stale cache.
27   echo "AC_INIT([$me], [1.0])" > configure.ac
28   case $1 in
29     DEFAULT) echo AM_MAINTAINER_MODE;;
30           *) echo "AM_MAINTAINER_MODE([$*])";;
31   esac >> configure.ac
32 }
33
34 check_configure_message_with ()
35 {
36   answer=$1; shift
37   ./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; }
38   cat stdout
39   grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
40   test `grep -c 'checking.*maint' stdout` -eq 1
41   :
42 }
43
44 set_maintmode "DEFAULT"
45
46 $ACLOCAL
47
48 $AUTOCONF --force
49
50 grep_configure_help --enable-maintainer-mode 'enable make rules'
51
52 check_configure_message_with "no"
53 check_configure_message_with "yes" --enable-maintainer-mode
54
55 set_maintmode "disable"
56
57 $AUTOCONF --force
58 grep_configure_help --enable-maintainer-mode 'enable make rules'
59
60 check_configure_message_with "no"
61 check_configure_message_with "yes" --enable-maintainer-mode
62
63 set_maintmode "enable"
64
65 $AUTOCONF --force
66 ./configure --help >stdout || { cat stdout; Exit 1; }
67 cat stdout
68 grep_configure_help --disable-maintainer-mode 'disable make rules'
69
70 check_configure_message_with "yes"
71 check_configure_message_with "no" --disable-maintainer-mode
72
73 :