automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] {yacc-work} tests: remove redundancy from silent lex/yacc tests


From: Stefano Lattarini
Subject: [PATCH] {yacc-work} tests: remove redundancy from silent lex/yacc tests
Date: Fri, 28 Jan 2011 17:06:51 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello automakers.

Finally a testsuite patch that offers a simplification rather
than a complication (at least IMHO).  The ChangeLog entry below
should explain the details.

OK for the 'yacc-work' branch?  I will push in 72 hours if
there's no objection.

Regards,
   Stefano

-*-*-

tests: remove redundancy from silent lex/yacc tests

* tests/silent-yacc-gcc.test, tests/silent-yacc-generic.test: Merge
these two testcases into ...
* tests/silent-yacc.test: ... this new one, which doesn't fiddle
which dependency tracking, as that shouldn't impact on generation
of yacc-derived C source and header files (and, for what concerns
compilation of C files, is already tested in other testcases).
* tests/silent-lex-gcc.test, tests/silent-lex-generic.test: Merge
these two testcases into ...
* tests/silent-lex.test: ... this new test, for similar reasons.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                      |   14 ++++
 tests/Makefile.am              |    6 +-
 tests/Makefile.in              |    6 +-
 tests/silent-lex-gcc.test      |  148 ---------------------------------------
 tests/silent-lex-generic.test  |  148 ---------------------------------------
 tests/silent-lex.test          |  135 ++++++++++++++++++++++++++++++++++++
 tests/silent-yacc-gcc.test     |  150 ----------------------------------------
 tests/silent-yacc-generic.test |  150 ----------------------------------------
 tests/silent-yacc.test         |  142 +++++++++++++++++++++++++++++++++++++
 9 files changed, 295 insertions(+), 604 deletions(-)
 delete mode 100755 tests/silent-lex-gcc.test
 delete mode 100755 tests/silent-lex-generic.test
 create mode 100755 tests/silent-lex.test
 delete mode 100755 tests/silent-yacc-gcc.test
 delete mode 100755 tests/silent-yacc-generic.test
 create mode 100755 tests/silent-yacc.test
From 76531665fd88baabd8ca2bed30f69ec5f290a259 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 28 Jan 2011 15:45:53 +0100
Subject: [PATCH] tests: remove redundancy from silent lex/yacc tests

* tests/silent-yacc-gcc.test, tests/silent-yacc-generic.test: Merge
these two testcases into ...
* tests/silent-yacc.test: ... this new one, which doesn't fiddle
which dependency tracking, as that shouldn't impact on generation
of yacc-derived C source and header files (and, for what concerns
compilation of C files, is already tested in other testcases).
* tests/silent-lex-gcc.test, tests/silent-lex-generic.test: Merge
these two testcases into ...
* tests/silent-lex.test: ... this new test, for similar reasons.
* tests/Makefile.am (TESTS): Update.
---
 ChangeLog                      |   14 ++++
 tests/Makefile.am              |    6 +-
 tests/Makefile.in              |    6 +-
 tests/silent-lex-gcc.test      |  148 ---------------------------------------
 tests/silent-lex-generic.test  |  148 ---------------------------------------
 tests/silent-lex.test          |  135 ++++++++++++++++++++++++++++++++++++
 tests/silent-yacc-gcc.test     |  150 ----------------------------------------
 tests/silent-yacc-generic.test |  150 ----------------------------------------
 tests/silent-yacc.test         |  138 ++++++++++++++++++++++++++++++++++++
 9 files changed, 291 insertions(+), 604 deletions(-)
 delete mode 100755 tests/silent-lex-gcc.test
 delete mode 100755 tests/silent-lex-generic.test
 create mode 100755 tests/silent-lex.test
 delete mode 100755 tests/silent-yacc-gcc.test
 delete mode 100755 tests/silent-yacc-generic.test
 create mode 100755 tests/silent-yacc.test

diff --git a/ChangeLog b/ChangeLog
index 4470c28..3962225 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-28   Stefano Lattarini  <address@hidden>
+
+       tests: remove redundancy from silent lex/yacc tests
+       * tests/silent-yacc-gcc.test, tests/silent-yacc-generic.test: Merge
+       these two testcases into ...
+       * tests/silent-yacc.test: ... this new one, which doesn't fiddle
+       which dependency tracking, as that shouldn't impact on generation
+       of yacc-derived C source and header files (and, for what concerns
+       compilation of C files, is already tested in other testcases).
+       * tests/silent-lex-gcc.test, tests/silent-lex-generic.test: Merge
+       these two testcases into ...
+       * tests/silent-lex.test: ... this new test, for similar reasons.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-01-22   Stefano Lattarini  <address@hidden>
 
        configure: look for a yacc program to be used by the testsuite
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e639b6c..d409adc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -644,10 +644,8 @@ silentf77.test \
 silentf90.test \
 silent-many-gcc.test \
 silent-many-generic.test \
-silent-lex-gcc.test \
-silent-lex-generic.test \
-silent-yacc-gcc.test \
-silent-yacc-generic.test \
+silent-lex.test \
+silent-yacc.test \
 silent-yacc-headers.test \
 sinclude.test \
 srcsub.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 25fc4a8..213a0ce 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -912,10 +912,8 @@ silentf77.test \
 silentf90.test \
 silent-many-gcc.test \
 silent-many-generic.test \
-silent-lex-gcc.test \
-silent-lex-generic.test \
-silent-yacc-gcc.test \
-silent-yacc-generic.test \
+silent-lex.test \
+silent-yacc.test \
 silent-yacc-headers.test \
 sinclude.test \
 srcsub.test \
diff --git a/tests/silent-lex-gcc.test b/tests/silent-lex-gcc.test
deleted file mode 100755
index 7550393..0000000
--- a/tests/silent-lex-gcc.test
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/bin/sh
-# 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
-# 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 Lex, forcing gcc depmode.
-# Keep this in sync with sister test `silent-lex-generic.test'.
-
-required='flex gcc'
-. ./defs || Exit 1
-
-set -e
-
-mkdir sub
-
-cat >>configure.in <<'EOF'
-AM_SILENT_RULES
-AM_PROG_CC_C_O
-AC_PROG_LEX
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo1 foo2
-foo1_SOURCES = foo.l
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_LFLAGS = -n
-foo2_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-LDADD = $(LEXLIB)
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = bar1 bar2
-bar1_SOURCES = bar.l
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_LFLAGS = -n
-bar2_CFLAGS = $(AM_CFLAGS)
-LDADD = $(LEXLIB)
-EOF
-
-cat > foo.l <<'EOF'
-%%
-"END"   return EOF;
-.
-%%
-EOF
-cp foo.l sub/bar.l
-
-$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'.
-for config_args in \
-  am_cv_CC_dependencies_compiler_type=gcc
-do
-  ./configure $config_args --enable-silent-rules
-
-  $MAKE >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  $EGREP ' (-c|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  grep 'LEX .*foo\.' stdout
-  grep 'LEX .*bar\.' stdout
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  # Don't look for LEX, as probably lex hasn't been re-run.
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' stdout
-
-  # Ensure a truly clean rebuild.
-  $MAKE clean
-  rm -f *foo.c sub/*bar.c
-
-  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-  grep 'ylwrap ' stdout
-
-  $EGREP '(LEX|CC|CCLD) ' 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 '(LEX|CC|CCLD) ' stdout && Exit 1
-
-  # Ensure a truly clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/tests/silent-lex-generic.test b/tests/silent-lex-generic.test
deleted file mode 100755
index 5322326..0000000
--- a/tests/silent-lex-generic.test
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/bin/sh
-# 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
-# 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 Lex.
-# Keep this in sync with sister test `silent-lex-gcc.test'.
-
-required='flex'
-. ./defs || Exit 1
-
-set -e
-
-mkdir sub
-
-cat >>configure.in <<'EOF'
-AM_SILENT_RULES
-AM_PROG_CC_C_O
-AC_PROG_LEX
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo1 foo2
-foo1_SOURCES = foo.l
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_LFLAGS = -n
-foo2_CFLAGS = $(AM_CFLAGS)
-SUBDIRS = sub
-LDADD = $(LEXLIB)
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = bar1 bar2
-bar1_SOURCES = bar.l
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_LFLAGS = -n
-bar2_CFLAGS = $(AM_CFLAGS)
-LDADD = $(LEXLIB)
-EOF
-
-cat > foo.l <<'EOF'
-%%
-"END"   return EOF;
-.
-%%
-EOF
-cp foo.l sub/bar.l
-
-$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.
-for config_args in \
-  --enable-dependency-tracking --disable-dependency-tracking
-do
-  ./configure $config_args --enable-silent-rules
-
-  $MAKE >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  $EGREP ' (-c|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  grep 'LEX .*foo\.' stdout
-  grep 'LEX .*bar\.' stdout
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  # Don't look for LEX, as probably lex hasn't been re-run.
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' stdout
-
-  # Ensure a truly clean rebuild.
-  $MAKE clean
-  rm -f *foo.c sub/*bar.c
-
-  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-  grep 'ylwrap ' stdout
-
-  $EGREP '(LEX|CC|CCLD) ' 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 '(LEX|CC|CCLD) ' stdout && Exit 1
-
-  # Ensure a truly clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/tests/silent-lex.test b/tests/silent-lex.test
new file mode 100755
index 0000000..32f9698
--- /dev/null
+++ b/tests/silent-lex.test
@@ -0,0 +1,135 @@
+#!/bin/sh
+# 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
+# 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 Lex.
+
+required='flex'
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AM_PROG_CC_C_O
+AC_PROG_LEX
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo1 foo2
+foo1_SOURCES = foo.l
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_LFLAGS = -n
+foo2_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+LDADD = $(LEXLIB)
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = bar1 bar2
+bar1_SOURCES = bar.l
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_LFLAGS = -n
+bar2_CFLAGS = $(AM_CFLAGS)
+LDADD = $(LEXLIB)
+EOF
+
+cat > foo.l <<'EOF'
+%%
+"END"   return EOF;
+.
+%%
+EOF
+cp foo.l sub/bar.l
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in || Exit 99
+$FGREP 'bar2-bar.c' sub/Makefile.in || Exit 99
+
+./configure --enable-silent-rules
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+grep 'LEX .*foo\.' stdout
+grep 'LEX .*bar\.' stdout
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep 'CCLD .*foo1' stdout
+grep 'CCLD .*bar1' stdout
+grep 'CCLD .*foo2' stdout
+grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+# Don't look for LEX, as probably lex hasn't been re-run.
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep 'CCLD .*foo1' stdout
+grep 'CCLD .*bar1' stdout
+grep 'CCLD .*foo2' stdout
+grep 'CCLD .*bar2' stdout
+
+# Ensure a truly clean rebuild.
+$MAKE clean
+rm -f *foo.c sub/*bar.c
+
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep ' -c ' stdout
+grep ' -o ' stdout
+grep 'ylwrap ' stdout
+
+$EGREP '(LEX|CC|CCLD) ' 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 '(LEX|CC|CCLD) ' stdout && Exit 1
+
+:
diff --git a/tests/silent-yacc-gcc.test b/tests/silent-yacc-gcc.test
deleted file mode 100755
index a1f2ae6..0000000
--- a/tests/silent-yacc-gcc.test
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/sh
-# 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
-# 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, forcing gcc depmode.
-# Keep this in sync with sister test `silent-yacc-generic.test'.
-
-required='gcc yacc'
-. ./defs || Exit 1
-
-set -e
-
-mkdir sub
-
-cat >>configure.in <<'EOF'
-AM_SILENT_RULES
-AM_PROG_CC_C_O
-AC_PROG_YACC
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo1 foo2
-foo1_SOURCES = foo.y
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_YFLAGS = -v
-foo2_CFLAGS = $(AM_CPPFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = bar1 bar2
-bar1_SOURCES = bar.y
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_YFLAGS = -v
-bar2_CFLAGS = $(AM_CPPFLAGS)
-EOF
-
-cat > foo.y <<'EOF'
-%{
-void yyerror (char *s) {}
-int yylex (void) {return 0;}
-int main(void) {return 0;}
-%}
-%token EOF
-%%
-fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
-EOF
-cp foo.y sub/bar.y
-
-$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'.
-for config_args in \
-  am_cv_CC_dependencies_compiler_type=gcc
-do
-  ./configure $config_args --enable-silent-rules
-
-  $MAKE >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  $EGREP ' (-c|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  grep 'YACC .*foo\.' stdout
-  grep 'YACC .*bar\.' stdout
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  # Don't look for YACC, as probably yacc hasn't been re-run.
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' stdout
-
-  # Ensure a truly clean rebuild.
-  $MAKE clean
-  rm -f *foo.[ch] sub/*bar.[ch]
-
-  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-  grep 'ylwrap ' stdout
-
-  $EGREP '(YACC|CC|CCLD) ' 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
-
-  # Ensure a truly clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/tests/silent-yacc-generic.test b/tests/silent-yacc-generic.test
deleted file mode 100755
index 52a98a8..0000000
--- a/tests/silent-yacc-generic.test
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/sh
-# 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
-# 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.
-# Keep this in sync with sister test `silent-yacc-gcc.test'.
-
-required=yacc
-. ./defs || Exit 1
-
-set -e
-
-mkdir sub
-
-cat >>configure.in <<'EOF'
-AM_SILENT_RULES
-AM_PROG_CC_C_O
-AC_PROG_YACC
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-EOF
-
-cat > Makefile.am <<'EOF'
-# Need generic and non-generic rules.
-bin_PROGRAMS = foo1 foo2
-foo1_SOURCES = foo.y
-foo2_SOURCES = $(foo1_SOURCES)
-foo2_YFLAGS = -v
-foo2_CFLAGS = $(AM_CPPFLAGS)
-SUBDIRS = sub
-EOF
-
-cat > sub/Makefile.am <<'EOF'
-AUTOMAKE_OPTIONS = subdir-objects
-# Need generic and non-generic rules.
-bin_PROGRAMS = bar1 bar2
-bar1_SOURCES = bar.y
-bar2_SOURCES = $(bar1_SOURCES)
-bar2_YFLAGS = -v
-bar2_CFLAGS = $(AM_CPPFLAGS)
-EOF
-
-cat > foo.y <<'EOF'
-%{
-void yyerror (char *s) {}
-int yylex (void) {return 0;}
-int main(void) {return 0;}
-%}
-%token EOF
-%%
-fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
-EOF
-cp foo.y sub/bar.y
-
-$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.
-for config_args in \
-  --enable-dependency-tracking --disable-dependency-tracking
-do
-  ./configure $config_args --enable-silent-rules
-
-  $MAKE >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  $EGREP ' (-c|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  grep 'YACC .*foo\.' stdout
-  grep 'YACC .*bar\.' stdout
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
-  $EGREP '(mv|ylwrap) ' stdout && Exit 1
-
-  # Don't look for YACC, as probably yacc hasn't been re-run.
-  grep ' CC .*foo\.' stdout
-  grep ' CC .*bar\.' stdout
-  grep 'CCLD .*foo1' stdout
-  grep 'CCLD .*bar1' stdout
-  grep 'CCLD .*foo2' stdout
-  grep 'CCLD .*bar2' stdout
-
-  # Ensure a truly clean rebuild.
-  $MAKE clean
-  rm -f *foo.[ch] sub/*bar.[ch]
-
-  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
-  cat stdout
-
-  grep ' -c ' stdout
-  grep ' -o ' stdout
-  grep 'ylwrap ' stdout
-
-  $EGREP '(YACC|CC|CCLD) ' 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
-
-  # Ensure a truly clean reconfiguration/rebuild.
-  $MAKE clean
-  $MAKE maintainer-clean
-
-done
-
-:
diff --git a/tests/silent-yacc.test b/tests/silent-yacc.test
new file mode 100755
index 0000000..4a5e46a
--- /dev/null
+++ b/tests/silent-yacc.test
@@ -0,0 +1,138 @@
+#!/bin/sh
+# 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
+# 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.
+# Keep this in sync with sister test `silent-yacc-gcc.test'.
+
+required=yacc
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AM_PROG_CC_C_O
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo1 foo2
+foo1_SOURCES = foo.y
+foo2_SOURCES = $(foo1_SOURCES)
+foo2_YFLAGS = -v
+foo2_CFLAGS = $(AM_CPPFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = bar1 bar2
+bar1_SOURCES = bar.y
+bar2_SOURCES = $(bar1_SOURCES)
+bar2_YFLAGS = -v
+bar2_CFLAGS = $(AM_CPPFLAGS)
+EOF
+
+cat > foo.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
+cp foo.y sub/bar.y
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# Ensure per-target rules are used, to ensure their coverage below.
+$FGREP 'foo2-foo.c' Makefile.in || Exit 99
+$FGREP 'bar2-bar.c' sub/Makefile.in || Exit 99
+
+./configure --enable-silent-rules
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+$EGREP ' (-c|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+grep 'YACC .*foo\.' stdout
+grep 'YACC .*bar\.' stdout
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep 'CCLD .*foo1' stdout
+grep 'CCLD .*bar1' stdout
+grep 'CCLD .*foo2' stdout
+grep 'CCLD .*bar2' 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|-o)' stdout && Exit 1
+$EGREP '(mv|ylwrap) ' stdout && Exit 1
+
+# Don't look for YACC, as probably yacc hasn't been re-run.
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep 'CCLD .*foo1' stdout
+grep 'CCLD .*bar1' stdout
+grep 'CCLD .*foo2' stdout
+grep 'CCLD .*bar2' stdout
+
+# Ensure a truly clean rebuild.
+$MAKE clean
+rm -f *foo.[ch] sub/*bar.[ch]
+
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+grep ' -c ' stdout
+grep ' -o ' stdout
+grep 'ylwrap ' stdout
+
+$EGREP '(YACC|CC|CCLD) ' 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
+
+:
-- 
1.7.2.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]