[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.11-2
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.11-276-g0283a95 |
Date: |
Sat, 22 Jan 2011 17:38:24 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=0283a956cd5f0a4522e2c3f1fa7155944464348e
The branch, yacc-work has been updated
via 0283a956cd5f0a4522e2c3f1fa7155944464348e (commit)
from 0532535cad4197145cef54918b641e373629b264 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0283a956cd5f0a4522e2c3f1fa7155944464348e
Author: Stefano Lattarini <address@hidden>
Date: Thu Jan 20 01:11:51 2011 +0100
tests: more coverage on yacc/lex silent-rules, plus minor cleanups
* tests/silent-yacc-gcc.test: Add sanity checks verifying that the
generated Makefile.in files really contains the non-generic rules
we expect. Do not redundantly manually remove files we know to be
already removed "make maintainer-clean".
(Makefile.am): Ensure we cover also non-generic yacc rules, by
setting target-specific YFLAGS.
(sub/Makefile.am): Likewise.
* tests/silent-yacc-generic.test: Likewise.
* tests/silent-lex-gcc.test: Likewise, but with LFLAGS instead of
YFLAGS.
* tests/silent-lex-generic.test: Likewise.
* tests/silent-many-gcc.test: Likewise, but with both LFLAGS and
YFLAGS. Also ...
(do_and_check_verbose_build): Remove redundant blank line.
* tests/silent-many-generic.test: Likewise.
* tests/silent-yacc-headers.test: New test.
* tests/Makefile.am (TESTS): Update.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 21 +++++
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
tests/silent-lex-gcc.test | 11 ++-
tests/silent-lex-generic.test | 11 ++-
tests/silent-many-gcc.test | 13 +++-
tests/silent-many-generic.test | 13 +++-
tests/silent-yacc-gcc.test | 9 ++-
tests/silent-yacc-generic.test | 9 ++-
tests/silent-yacc-headers.test | 175 ++++++++++++++++++++++++++++++++++++++++
10 files changed, 250 insertions(+), 14 deletions(-)
create mode 100755 tests/silent-yacc-headers.test
diff --git a/ChangeLog b/ChangeLog
index 5d2d1c0..331246c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-22 Stefano Lattarini <address@hidden>
+
+ tests: more coverage on yacc/lex silent-rules, plus minor cleanups
+ * tests/silent-yacc-gcc.test: Add sanity checks verifying that the
+ generated Makefile.in files really contains the non-generic rules
+ we expect. Do not redundantly manually remove files we know to be
+ already removed "make maintainer-clean".
+ (Makefile.am): Ensure we cover also non-generic yacc rules, by
+ setting target-specific YFLAGS.
+ (sub/Makefile.am): Likewise.
+ * tests/silent-yacc-generic.test: Likewise.
+ * tests/silent-lex-gcc.test: Likewise, but with LFLAGS instead of
+ YFLAGS.
+ * tests/silent-lex-generic.test: Likewise.
+ * tests/silent-many-gcc.test: Likewise, but with both LFLAGS and
+ YFLAGS. Also ...
+ (do_and_check_verbose_build): Remove redundant blank line.
+ * tests/silent-many-generic.test: Likewise.
+ * tests/silent-yacc-headers.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
2011-01-22 Stefano Lattarini <address@hidden>
tests: fix spurious failures in yflags*.test
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 39f1a39..e639b6c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -648,6 +648,7 @@ silent-lex-gcc.test \
silent-lex-generic.test \
silent-yacc-gcc.test \
silent-yacc-generic.test \
+silent-yacc-headers.test \
sinclude.test \
srcsub.test \
srcsub2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 0ea9825..5eedb76 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -915,6 +915,7 @@ silent-lex-gcc.test \
silent-lex-generic.test \
silent-yacc-gcc.test \
silent-yacc-generic.test \
+silent-yacc-headers.test \
sinclude.test \
srcsub.test \
srcsub2.test \
diff --git a/tests/silent-lex-gcc.test b/tests/silent-lex-gcc.test
index 426dc50..7550393 100755
--- a/tests/silent-lex-gcc.test
+++ b/tests/silent-lex-gcc.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ cat > Makefile.am <<'EOF'
bin_PROGRAMS = foo1 foo2
foo1_SOURCES = foo.l
foo2_SOURCES = $(foo1_SOURCES)
+foo2_LFLAGS = -n
foo2_CFLAGS = $(AM_CFLAGS)
SUBDIRS = sub
LDADD = $(LEXLIB)
@@ -48,6 +49,7 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = bar1 bar2
bar1_SOURCES = bar.l
bar2_SOURCES = $(bar1_SOURCES)
+bar2_LFLAGS = -n
bar2_CFLAGS = $(AM_CFLAGS)
LDADD = $(LEXLIB)
EOF
@@ -64,6 +66,10 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in
+$FGREP 'bar2-bar.c' sub/Makefile.in
+
# Force gcc ("fast") depmode.
# This apparently useless "for" loop is here to simplify the syncing
# with sister test `silent-lex-gcc.test'.
@@ -108,7 +114,7 @@ do
# Ensure a truly clean rebuild.
$MAKE clean
- rm -f foo.c sub/bar.c
+ rm -f *foo.c sub/*bar.c
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
@@ -136,7 +142,6 @@ do
# Ensure a truly clean reconfiguration/rebuild.
$MAKE clean
$MAKE maintainer-clean
- rm -f foo.c sub/bar.c
done
diff --git a/tests/silent-lex-generic.test b/tests/silent-lex-generic.test
index 66535e8..5322326 100755
--- a/tests/silent-lex-generic.test
+++ b/tests/silent-lex-generic.test
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ cat > Makefile.am <<'EOF'
bin_PROGRAMS = foo1 foo2
foo1_SOURCES = foo.l
foo2_SOURCES = $(foo1_SOURCES)
+foo2_LFLAGS = -n
foo2_CFLAGS = $(AM_CFLAGS)
SUBDIRS = sub
LDADD = $(LEXLIB)
@@ -48,6 +49,7 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = bar1 bar2
bar1_SOURCES = bar.l
bar2_SOURCES = $(bar1_SOURCES)
+bar2_LFLAGS = -n
bar2_CFLAGS = $(AM_CFLAGS)
LDADD = $(LEXLIB)
EOF
@@ -64,6 +66,10 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in
+$FGREP 'bar2-bar.c' sub/Makefile.in
+
# Force dependency tracking explicitly, so that slow dependency
# extractors are not rejected. Try also with dependency tracking
# explicitly disabled.
@@ -108,7 +114,7 @@ do
# Ensure a truly clean rebuild.
$MAKE clean
- rm -f foo.c sub/bar.c
+ rm -f *foo.c sub/*bar.c
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
@@ -136,7 +142,6 @@ do
# Ensure a truly clean reconfiguration/rebuild.
$MAKE clean
$MAKE maintainer-clean
- rm -f foo.c sub/bar.c
done
diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test
index 5e6d191..1732d9d 100755
--- a/tests/silent-many-gcc.test
+++ b/tests/silent-many-gcc.test
@@ -73,7 +73,6 @@ do_and_check_silent_build ()
# Avoids too much code duplication.
do_and_check_verbose_build ()
{
-
case $1 in
--rebuild) rebuild=true;;
*) rebuild=false;;
@@ -118,6 +117,8 @@ fo2_SOURCES = $(foo_SOURCES)
fo2_CPPFLAGS = $(AM_CPPFLAGS)
fo2_FFLAGS = $(AM_FFLAGS)
fo2_FCFLAGS = $(AM_FCFLAGS)
+fo2_YFLAGS = -v
+fo2_LFLAGS = -n
SUBDIRS = sub
AM_YFLAGS = -d
LDADD = $(LEXLIB)
@@ -134,6 +135,8 @@ ba2_SOURCES = $(baz_SOURCES)
ba2_CPPFLAGS = $(AM_CPPFLAGS)
ba2_FFLAGS = $(AM_FFLAGS)
ba2_FCFLAGS = $(AM_FCFLAGS)
+ba2_YFLAGS = -v
+ba2_LFLAGS = -n
AM_YFLAGS = -d
LDADD = $(LEXLIB)
BUILT_SOURCES = baz6.h
@@ -182,6 +185,12 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+# (We do not do an exhaustive check, that wouldn't be practical).
+$FGREP 'bar-bar.o' Makefile.in
+$FGREP 'fo2-foo5.c' Makefile.in
+$FGREP 'fo2-foo6.c' Makefile.in
+
# Force gcc ("fast") depmode.
# This apparently useless "for" loop is here to simplify the syncing
# with sister test `silent-many-gcc.test'.
@@ -202,7 +211,7 @@ do
$MAKE clean
# This is required, since these files are not removed by `make clean'
# (as dictated by the GNU Coding Standards).
- rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
+ rm -f *foo5.c *foo6.[ch] sub/*baz5.c sub/*baz6.[ch]
do_and_check_verbose_build
# Cleaning and then rebuilding with the same V flag (and without
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index ed27448..0502bf8 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -75,7 +75,6 @@ do_and_check_silent_build ()
# Avoids too much code duplication.
do_and_check_verbose_build ()
{
-
case $1 in
--rebuild) rebuild=true;;
*) rebuild=false;;
@@ -120,6 +119,8 @@ fo2_SOURCES = $(foo_SOURCES)
fo2_CPPFLAGS = $(AM_CPPFLAGS)
fo2_FFLAGS = $(AM_FFLAGS)
fo2_FCFLAGS = $(AM_FCFLAGS)
+fo2_YFLAGS = -v
+fo2_LFLAGS = -n
SUBDIRS = sub
AM_YFLAGS = -d
LDADD = $(LEXLIB)
@@ -136,6 +137,8 @@ ba2_SOURCES = $(baz_SOURCES)
ba2_CPPFLAGS = $(AM_CPPFLAGS)
ba2_FFLAGS = $(AM_FFLAGS)
ba2_FCFLAGS = $(AM_FCFLAGS)
+ba2_YFLAGS = -v
+ba2_LFLAGS = -n
AM_YFLAGS = -d
LDADD = $(LEXLIB)
BUILT_SOURCES = baz6.h
@@ -184,6 +187,12 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+# (We do not do an exhaustive check, that wouldn't be practical).
+$FGREP 'bar-bar.o' Makefile.in
+$FGREP 'fo2-foo5.c' Makefile.in
+$FGREP 'fo2-foo6.c' Makefile.in
+
# Force dependency tracking explicitly, so that slow dependency
# extractors are not rejected. Try also with dependency tracking
# explicitly disabled.
@@ -204,7 +213,7 @@ do
$MAKE clean
# This is required, since these files are not removed by `make clean'
# (as dictated by the GNU Coding Standards).
- rm -f foo5.c foo6.[ch] sub/baz5.c sub/baz6.[ch]
+ rm -f *foo5.c *foo6.[ch] sub/*baz5.c sub/*baz6.[ch]
do_and_check_verbose_build
# Cleaning and then rebuilding with the same V flag (and without
diff --git a/tests/silent-yacc-gcc.test b/tests/silent-yacc-gcc.test
index 83e6ebe..a1f2ae6 100755
--- a/tests/silent-yacc-gcc.test
+++ b/tests/silent-yacc-gcc.test
@@ -37,6 +37,7 @@ cat > Makefile.am <<'EOF'
bin_PROGRAMS = foo1 foo2
foo1_SOURCES = foo.y
foo2_SOURCES = $(foo1_SOURCES)
+foo2_YFLAGS = -v
foo2_CFLAGS = $(AM_CPPFLAGS)
SUBDIRS = sub
EOF
@@ -47,6 +48,7 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = bar1 bar2
bar1_SOURCES = bar.y
bar2_SOURCES = $(bar1_SOURCES)
+bar2_YFLAGS = -v
bar2_CFLAGS = $(AM_CPPFLAGS)
EOF
@@ -66,6 +68,10 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in
+$FGREP 'bar2-bar.c' sub/Makefile.in
+
# Force gcc ("fast") depmode.
# This apparently useless "for" loop is here to simplify the syncing
# with sister test `silent-yacc-gcc.test'.
@@ -110,7 +116,7 @@ do
# Ensure a truly clean rebuild.
$MAKE clean
- rm -f foo.[ch] sub/bar.[ch]
+ rm -f *foo.[ch] sub/*bar.[ch]
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
@@ -138,7 +144,6 @@ do
# Ensure a truly clean reconfiguration/rebuild.
$MAKE clean
$MAKE maintainer-clean
- rm -f foo.[ch] sub/bar.[ch]
done
diff --git a/tests/silent-yacc-generic.test b/tests/silent-yacc-generic.test
index 553e78b..52a98a8 100755
--- a/tests/silent-yacc-generic.test
+++ b/tests/silent-yacc-generic.test
@@ -37,6 +37,7 @@ cat > Makefile.am <<'EOF'
bin_PROGRAMS = foo1 foo2
foo1_SOURCES = foo.y
foo2_SOURCES = $(foo1_SOURCES)
+foo2_YFLAGS = -v
foo2_CFLAGS = $(AM_CPPFLAGS)
SUBDIRS = sub
EOF
@@ -47,6 +48,7 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = bar1 bar2
bar1_SOURCES = bar.y
bar2_SOURCES = $(bar1_SOURCES)
+bar2_YFLAGS = -v
bar2_CFLAGS = $(AM_CPPFLAGS)
EOF
@@ -66,6 +68,10 @@ $ACLOCAL
$AUTOMAKE --add-missing
$AUTOCONF
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in
+$FGREP 'bar2-bar.c' sub/Makefile.in
+
# Force dependency tracking explicitly, so that slow dependency
# extractors are not rejected. Try also with dependency tracking
# explicitly disabled.
@@ -110,7 +116,7 @@ do
# Ensure a truly clean rebuild.
$MAKE clean
- rm -f foo.[ch] sub/bar.[ch]
+ rm -f *foo.[ch] sub/*bar.[ch]
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
@@ -138,7 +144,6 @@ do
# Ensure a truly clean reconfiguration/rebuild.
$MAKE clean
$MAKE maintainer-clean
- rm -f foo.[ch] sub/bar.[ch]
done
diff --git a/tests/silent-yacc-headers.test b/tests/silent-yacc-headers.test
new file mode 100755
index 0000000..f8dd99e
--- /dev/null
+++ b/tests/silent-yacc-headers.test
@@ -0,0 +1,175 @@
+#!/bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check silent-rules mode for Yacc, when yacc-generated headers are
+# involved (i.e., the `-d' option is in *YFLAGS).
+
+required=yacc
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_PROG_YACC
+AC_PROG_CC
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+AM_YFLAGS = -d
+bin_PROGRAMS = foo bar
+foo_SOURCES = parse.y
+bar_SOURCES = $(foo_SOURCES)
+bar_YFLAGS = $(AM_YFLAGS)
+EOF
+
+cat > parse.y <<'EOF'
+%{
+void yyerror (char *s) { return; }
+int yylex (void) { return 0; }
+int main (void) { return 0; }
+%}
+%token EOF
+%%
+fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
+EOF
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Check that the expected non-generic rules has been truly generated.
+# Otherwise, the coverage offered by this test will be weaker then
+# expected and planned.
+$FGREP 'bar-parse.c' Makefile.in
+$FGREP '$(bar_YFLAGS)' Makefile.in
+
+./configure --enable-silent-rules
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-d|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+grep 'YACC *parse\.c' stdout
+grep 'updating *parse\.h' stdout
+grep 'YACC *bar-parse\.c' stdout
+grep 'updating *bar-parse\.h' stdout
+
+grep ' CC *parse\.' stdout
+grep ' CC *bar-parse\.' stdout
+grep 'CCLD *foo' stdout
+grep 'CCLD *bar' stdout
+
+# Check recovering from header removal.
+rm -f parse.h bar-parse.h
+$MAKE parse.h bar-parse.h >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-d|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+grep 'YACC *parse\.c' stdout
+grep 'updating *parse\.h' stdout
+grep 'YACC *bar-parse\.c' stdout
+grep 'updating *bar-parse\.h' stdout
+
+# Cleaning and then rebuilding with the same V flag (and without
+# removing the generated sources in between) shouldn't trigger a
+# different set of rules.
+$MAKE clean
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-d|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+# Don't look for "YACC *.c" and "updating *.h", as yacc shouldn't
+# have been re-run.
+grep ' CC *parse\.' stdout
+grep ' CC *bar-parse\.' stdout
+grep 'CCLD *foo' stdout
+grep 'CCLD *bar' stdout
+
+# Check recovering from header removal.
+rm -f parse.h bar-parse.h
+$MAKE parse.h bar-parse.h >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-d|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+grep 'YACC *parse\.c' stdout
+grep 'updating *parse\.h' stdout
+grep 'YACC *bar-parse\.c' stdout
+grep 'updating *bar-parse\.h' stdout
+
+# Ensure a truly clean rebuild.
+$MAKE maintainer-clean
+
+./configure --enable-silent-rules
+
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep ' -c ' stdout
+grep ' -o ' stdout
+grep ' -d ' stdout
+grep 'ylwrap ' stdout
+
+$EGREP '(YACC|CC|CCLD) ' stdout && Exit 1
+
+# Check recovering from header removal.
+rm -f parse.h bar-parse.h
+$MAKE V=1 parse.h bar-parse.h >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep ' -d ' stdout
+grep 'ylwrap ' stdout
+
+grep 'YACC' stdout && Exit 1
+
+# Cleaning and then rebuilding with the same V flag (and without
+# removing the generated sources in between) shouldn't trigger a
+# different set of rules.
+$MAKE clean
+
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+# Don't look for ylwrap, as probably lex hasn't been re-run.
+grep ' -c ' stdout
+grep ' -o ' stdout
+
+$EGREP '(YACC|CC|CCLD) ' stdout && Exit 1
+
+# Check recovering from header removal.
+rm -f parse.h bar-parse.h
+$MAKE V=1 parse.h bar-parse.h >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep ' -d ' stdout
+grep 'ylwrap ' stdout
+
+grep 'YACC' stdout && Exit 1
+
+:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.11-276-g0283a95,
Stefano Lattarini <=