source: trunk/essentials/sys-devel/automake-1.8/tests/vars3.test

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 2.4 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Automake; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Check that Automake warns about variables containing spaces
22# and other non-POSIX characters.
23
24. ./defs || exit 1
25
26set -e
27
28cat >Makefile.am <<'EOF'
29L01 = $(shell echo *)
30L02 = $$(not an error)
31L03 = $$(this is)$${ok too}
32L04 = $(nextvariableisbad)$(addsuffix .a, $(A))
33L05 = "$(bad boy)"
34L06 = $(this:is= ok)
35L07 = ${three errors}${on this} $(long line)
36L08$(o u c h): $(wildcard *.c)
37 ${another error}
38 echo $${ok-this is}
39L11: $(thisis) $(ok)
40 ${here}
41EOF
42
43$ACLOCAL
44# Make sure this warning is print in the `portability' category.
45$AUTOMAKE --warnings=no-error,none,portability 2>stderr
46cat stderr
47
48# Lines number are printed in error message.
49# Use them to make sure errors are diagnosed against the right lines.
50
51# No error expected for these lines.
52grep 1: stderr
53grep 2: stderr && exit 1
54grep 3: stderr && exit 1
55grep 4: stderr
56grep 5: stderr
57grep 6: stderr && exit 1
58grep 7: stderr
59grep 8: stderr
60grep 9: stderr
61grep 10: stderr && exit 1
62grep 11: stderr && exit 1
63grep 12: stderr && exit 1
64
65# Now check some individual values.
66grep 'shell echo' stderr
67grep 'nextvariableisbad' stderr && exit 1
68grep 'addsuffix' stderr
69grep 'bad boy' stderr
70grep 'ok' stderr && exit 1
71grep 'three errors' stderr
72grep 'on this' stderr
73grep 'long line' stderr
74grep 'o u c h' stderr
75grep 'wildcard' stderr
76grep 'another error' stderr
77grep 'thisis' stderr && exit 1
78grep 'here' stderr && exit 1
79
80# None of these errors be diagnosed with -Wno-portability
81$AUTOMAKE -Wno-portability
82
83# Likewise if we add this in the Makefile.am
84# (although this makes some difference internally: AUTOMAKE_OPTIONS is
85# processed far later).
86echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
87$AUTOMAKE
Note: See TracBrowser for help on using the repository browser.