Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / obsolete.test
1 #! /bin/sh
2 # Copyright (C) 1996, 2001, 2002, 2007, 2008, 2010 Free Software
3 # Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Test to make sure obsolete macros can be autoupdated.
19
20 # We need the following indirection in case someone exported e.g.
21 # AUTOUPDATE='autoupdate --verbose'.
22 set x ${AUTOUPDATE-autoupdate}
23 required=$2
24 . ./defs || Exit 1
25
26 cat > configure.in << 'END'
27 AC_INIT
28 END
29
30 $PERL -ne '/AU_DEFUN\(\[(\w+)\]/ && print "$1\n"' \
31     "$testsrcdir/../m4/obsolete.m4" >> obs
32 cat obs >> configure.in
33 $PERL -ne 'chomp; print "grep $_ stderr || Exit 1\n"; ' obs > obs.1
34 $PERL -ne 'chomp; print "grep $_ configure.in && Exit 1\n"; ' obs > obs.2
35
36 # Sanity check.  Make sure we have added something to configure.in.
37 test `cat configure.in | wc -l` -gt 1 || Exit 1
38
39 $ACLOCAL || Exit 1
40
41 # Expect Autoconf to complain about each of the macros in obs.
42 $AUTOCONF -Wobsolete >stderr 2>&1
43 . ./obs.1
44 # Make sure Autoupdate remove each of these macros.
45 $AUTOUPDATE || Exit 1
46 . ./obs.2
47
48 # Autoconf should be able to grok the updated configure.in.
49 $AUTOCONF || Exit 1
50
51 Exit 0