2 # Copyright (C) 2013-2015 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)
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 # Tests error messages when '%reldir%' and '%canon_reldir%' substitutions
18 # (and their shorthands '%D%' and '%C%') are involved.
22 cat >> configure.ac
<<'END'
32 cat > Makefile.am
<<'END'
33 %canon_reldir%_x1_SOURCES = bar.c
37 cat > sub
/local.mk
<<'END'
38 AUTOMAKE_OPTIONS = -Wno-extra-portability
39 include %D%/sub2/more.mk
40 noinst_LIBRARIES = %reldir%-one.a %D%-two.a
41 %C%_x2_SOURCES = foo.c
44 cat > sub
/sub
2/more.mk
<<'END'
51 cat > expected
<< 'END'
52 sub
/sub
2/more.mk
:1: sub_sub2_UNDEFINED must be
set with
'=' before using
'+='
53 Makefile.am
:2: 'sub/local.mk' included from here
54 sub
/local.mk
:2: 'sub/sub2/more.mk' included from here
55 sub
/local.mk
:3: 'sub-one.a' is not a standard library name
56 sub
/local.mk
:3: did you mean
'libsub-one.a'?
57 Makefile.am
:2: 'sub/local.mk' included from here
58 sub
/local.mk
:3: 'sub-two.a' is not a standard library name
59 sub
/local.mk
:3: did you mean
'libsub-two.a'?
60 Makefile.am
:2: 'sub/local.mk' included from here
61 sub
/local.mk
:4: variable
'sub_x2_SOURCES' is defined but no program or
62 sub
/local.mk
:4: library has
'sub_x2' as canonical name
(possible typo
)
63 Makefile.am
:2: 'sub/local.mk' included from here
64 Makefile.am
:1: variable
'x1_SOURCES' is defined but no program or
65 Makefile.am
:1: library has
'x1' as canonical name
(possible typo
)
68 # We need to break these substitutions into multiple sed invocations
69 # to avoid spuriously triggering the 'sc_tests_logs_duplicate_prefixes'
71 sed -e '/warnings are treated as errors/d' stderr
> t1
72 sed -e 's/: warning:/:/' t1
> t2
73 sed -e 's/: error:/:/' t2
> t3
74 sed -e 's/ */ /g' t3
> obtained
76 diff expected obtained