tests: give few aclocal tests more significant names
[automake.git] / t / tags-pr12372.sh
blobe232d5fe4e63840d7f5a2cb30eeb6a1deba2b986
1 #! /bin/sh
2 # Copyright (C) 2012 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)
7 # any later version.
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 # Test to make sure tags are processed also for files with non-standard
18 # extensions. See automake bug#12372.
20 required='cc etags'
21 . test-init.sh
23 cat >> configure.ac <<'END'
24 AC_PROG_CC
25 AC_CONFIG_FILES([sub/Makefile])
26 AC_OUTPUT
27 END
29 cat > Makefile.am <<'END'
30 all-local: tags
31 .pc.o:
32 sed -e 's/\[/{/' -e 's/\]/}/' $(srcdir)/$*.pc >$*.c
33 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
34 rm -f $*.c
36 LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
37 noinst_PROGRAMS = foo
38 foo_SOURCES = foo-main.pc barbar.c
39 SUBDIRS = sub
40 END
42 mkdir sub
43 cat > sub/Makefile.am <<'END'
44 all-local: tags
45 .pc.o:
46 sed -e 's/@/a/g' $(srcdir)/$*.pc >$*.c
47 $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $*.c
48 rm -f $*.c
50 LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
51 noinst_PROGRAMS = zap
52 zap_SOURCES = zardoz.pc
53 END
55 echo 'int main(void) [ return bar(1); ]' > foo-main.pc
56 echo 'int bar(int x) { return !x; }' > barbar.c
57 echo 'int m@in(void) { return 0; }' > sub/zardoz.pc
59 $ACLOCAL
60 $AUTOCONF
61 $AUTOMAKE
63 ./configure
65 $MAKE
66 cat TAGS
67 cat sub/TAGS
68 $FGREP foo-main.pc TAGS
69 $FGREP barbar.c TAGS
70 $FGREP zardoz.pc sub/TAGS
72 $MAKE distcheck