tests: expose automake bug#14560
[platform/upstream/automake.git] / t / doc-parsing-buglets-tabs.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 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 # Check the documented limitation of the Automake's Makefile parser w.r.t.
18 # use of TAB characters; see Section "General Operation" in the Automake
19 # manual, and automake bug#8360.
20 # If you cause some parts of this test to fail, chances are that you've
21 # improved the Automake parser ;-)
22
23 . test-init.sh
24
25 cat > Makefile.am <<END
26 .PHONY: test
27 test: all check
28
29 fail:
30 ${tab}@echo "'\$@ recipe executed'"; exit 1
31
32 ## This won't be recognized as a target+recipe by Automake.
33 all-local${tab}:
34 ${tab}@exit 1
35
36 ## This won't be recognized as a target+rdependency by Automake.
37 all-local${tab}: fail
38
39 just_to_separate: dummy deps
40
41 ## This won't be recognized as a variable assignment by Automake.
42 ${tab}bin_PROGRAMS = foo
43 END
44
45 echo AC_OUTPUT >> configure.ac
46
47 $ACLOCAL
48 $AUTOMAKE
49
50 $FGREP '$(EXEEEXT)' Makefile.in && exit 1
51 grep 'all:.*all-local' Makefile.in && exit 1
52 grep "^${tab}bin_PROGRAMS = foo" Makefile.in
53
54 $AUTOCONF
55 ./configure
56
57 $MAKE test
58
59 :