From: Stefano Lattarini Date: Wed, 7 Nov 2012 22:40:59 +0000 (+0100) Subject: tests: remove mostly-redundant tests on silent rules X-Git-Tag: v1.12b~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=696f44c0840d931656f986e9f4fb623e63df16ba;p=thirdparty%2Fautomake.git tests: remove mostly-redundant tests on silent rules We used to have several couples of tests named like 'silent-foo-gcc.sh' and 'silent-foo-generic.sh'. Differently from what the names suggest, the first test in such a couple (that is, "silent-foo-gcc.sh") was not meant to check specific GCC-related features, but rather to check how the silent rules behave in combination with automatic dependency tracking when the 'gcc' depmode (that targets GCC versions before the 3.x and 4.x release series) is forced. Such depmode forcing was done exclusively to cover the code paths in 'lib/am/depend2.am' that actually invoke the 'depcomp' script, rather than using the inlined, GCC-specific compiler invocation (the so-called "fastdep" mode), which is the default with modern GCC or with other modern compilers that can emulate the GCC command-line interface (e.g., clang 3.0). But whenever we run the silent-*-generic.sh" tests with other supported compilers which have an associated depmode different from 'gcc3', these same "non-fastdep" code paths are covered, since in those tests we run ./configure with the '--enable-dependency-tracking' option, which causes slower depmodes not to be rejected. Examples of such compilers are the Sun C and C++ compilers (at least since version 5.9, a.k.a. Sun Studio 12.1), and the Tiny C Compiler (from version 0.9.26); and I run the Automake testsuite quite regularly with those compilers. So, the "silent-*-gcc.sh" test cases don't offer any real coverage enhancements, while still using testsuite runtime and causing some (admittedly minor, but still annoying) synchronization headaches with the sister tests "silent-foo-general.sh" tests. So let's just remove these "silent-*-gcc.sh" tests. * t/silent-c-gcc.sh: Remove. * t/silent-cxx-gcc.sh: Likewise. * t/silent-lt-gcc.sh: Likewise. * t/silent-many-gcc.sh: Likewise. * t/silent-c-generic.sh: Rename ... * t/silent-c.sh: ... like this, and adjust heading comments. * t/silent-cxx-generic.sh: Rename ... * t/silent-cxx.sh: ... like this, and adjust heading comments. * t/silent-lt-generic.sh: Rename ... * t/silent-lt.sh: ... like this, and adjust heading comments. * t/silent-many-generic.sh: Rename ... * t/silent-many-languages.sh: ... like this, and adjust heading comments. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini --- diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 34df7bf4d..89ec37d0b 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -966,17 +966,13 @@ t/self-check-is-blocked-signal.tap \ t/self-check-unindent.tap \ t/sanity.sh \ t/seenc.sh \ -t/silent-c-generic.sh \ -t/silent-c-gcc.sh \ -t/silent-lt-generic.sh \ -t/silent-lt-gcc.sh \ -t/silent-gen.sh \ -t/silent-cxx-generic.sh \ -t/silent-cxx-gcc.sh \ +t/silent-c.sh \ +t/silent-cxx.sh \ +t/silent-lt.sh \ t/silent-f77.sh \ t/silent-f90.sh \ -t/silent-many-gcc.sh \ -t/silent-many-generic.sh \ +t/silent-many-languages.sh \ +t/silent-gen.sh \ t/silent-texi.sh \ t/silent-lex.sh \ t/silent-yacc.sh \ diff --git a/t/silent-c-gcc.sh b/t/silent-c-gcc.sh deleted file mode 100755 index 3f607b2b5..000000000 --- a/t/silent-c-gcc.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# Copyright (C) 2009-2012 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 . - -# Check silent-rules mode, without libtool, non-fastdep case -# (so that, with GCC, we also cover the other code paths in depend2). - -# Please keep this file in sync with 'silent-c-generic.sh'. - -required=gcc -. test-init.sh - -mkdir sub - -cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) -AC_PROG_CC -AM_PROG_CC_C_O -AC_OUTPUT -EOF - -cat > Makefile.am <<'EOF' -# Need generic and non-generic rules. -bin_PROGRAMS = foo bar -bar_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla -bla_CFLAGS = $(AM_CFLAGS) -EOF - -cat > foo.c <<'EOF' -int main () -{ - return 0; -} -EOF -cp foo.c bar.c -cp foo.c sub/baz.c -cp foo.c sub/bla.c - -$ACLOCAL -$AUTOMAKE --add-missing -$AUTOCONF - -./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules -$MAKE >stdout || { cat stdout; exit 1; } -cat stdout -$EGREP ' (-c|-o)' stdout && exit 1 -grep 'mv ' stdout && exit 1 -grep 'CC .*foo\.' stdout -grep 'CC .*bar\.' stdout -grep 'CC .*baz\.' stdout -grep 'CC .*bla\.' stdout -grep 'CCLD .*foo' stdout -grep 'CCLD .*bar' stdout -grep 'CCLD .*baz' stdout -grep 'CCLD .*bla' stdout - -$MAKE clean -$MAKE V=1 >stdout || { cat stdout; exit 1; } -cat stdout -grep ' -c' stdout -grep ' -o foo' stdout -$EGREP '(CC|LD) ' stdout && exit 1 - -: diff --git a/t/silent-c-generic.sh b/t/silent-c.sh similarity index 93% rename from t/silent-c-generic.sh rename to t/silent-c.sh index a241a6c28..82b95873a 100755 --- a/t/silent-c-generic.sh +++ b/t/silent-c.sh @@ -14,9 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check silent-rules mode, without libtool, standard depmode case. - -# Please keep this file in sync with 'silent-c-gcc.sh'. +# Check silent-rules mode for C, without libtool, both with and without +# automatic dependency tracking. required=cc . test-init.sh diff --git a/t/silent-cxx-gcc.sh b/t/silent-cxx-gcc.sh deleted file mode 100755 index 3994abe86..000000000 --- a/t/silent-cxx-gcc.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh -# Copyright (C) 2010-2012 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 . - -# Check silent-rules mode for C++. -# This test requires the GNU C++ compiler; keep it in sync with sister -# test 'silent-cxx-generic.sh', which should work with generic compilers. - -required=g++ -. test-init.sh - -mkdir sub - -cat >>configure.ac <<'EOF' -AC_PROG_CXX -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.cpp baz.cxx quux.cc -foo2_SOURCES = $(foo1_SOURCES) -foo2_CXXFLAGS = $(AM_CXXFLAGS) -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.cpp -bar2_SOURCES = $(bar1_SOURCES) -bar2_CXXFLAGS = $(AM_CXXFLAGS) -EOF - -cat > foo.cpp <<'EOF' -using namespace std; /* C compilers fail on this. */ -int main() { return 0; } -EOF - -# Let's try out other extensions too. -echo 'class Baz { public: int i; };' > baz.cxx -echo 'class Quux { public: bool b; };' > quux.cc - -cp foo.cpp sub/bar.cpp - -$ACLOCAL -$AUTOMAKE --add-missing -$AUTOCONF - -# Sanity check: make sure the cache variable we force is really used -# by configure. -$FGREP am_cv_CXX_dependencies_compiler_type configure - -# Force gcc ("fast") depmode. -# This apparently useless "for" loop is here to simplify the syncing -# with sister test 'silentcxx.sh'. -for config_args in \ - am_cv_CXX_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 - grep 'mv ' stdout && exit 1 - - grep 'CXX .*foo\.' stdout - grep 'CXX .*baz\.' stdout - grep 'CXX .*quux\.' stdout - grep 'CXX .*bar\.' stdout - grep 'CXXLD .*foo1' stdout - grep 'CXXLD .*bar1' stdout - grep 'CXXLD .*foo2' stdout - grep 'CXXLD .*bar2' stdout - - # Ensure a clean rebuild. - $MAKE clean - - $MAKE V=1 >stdout || { cat stdout; exit 1; } - cat stdout - - grep ' -c ' stdout - grep ' -o ' stdout - - $EGREP '(CC|CXX|LD) ' stdout && exit 1 - - # Ensure a clean reconfiguration/rebuild. - $MAKE clean - $MAKE maintainer-clean - -done - -: diff --git a/t/silent-cxx-generic.sh b/t/silent-cxx.sh similarity index 92% rename from t/silent-cxx-generic.sh rename to t/silent-cxx.sh index 766d3f995..0a7aa82e2 100755 --- a/t/silent-cxx-generic.sh +++ b/t/silent-cxx.sh @@ -14,10 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check silent-rules mode for C++. -# This test should work with generic C++ compilers; keep it in sync with -# sister test 'silent-cxx-gcc.sh', which requires the GNU C++ compiler -# and forces the use of gcc depmode. +# Check silent-rules mode for C++, both with and without automatic +# dependency tracking. required=c++ . test-init.sh diff --git a/t/silent-lt-gcc.sh b/t/silent-lt-gcc.sh deleted file mode 100755 index f9c955517..000000000 --- a/t/silent-lt-gcc.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# Copyright (C) 2009-2012 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 . - -# Check silent-rules mode, with libtool, non-fastdep case -# (so that, with GCC, we also cover the other code paths in depend2). - -# Please keep this file in sync with 'silent-lt-generic.sh'. - -required="libtoolize gcc" -. test-init.sh - -mkdir sub - -cat >>configure.ac <<'EOF' -AC_CONFIG_FILES([sub/Makefile]) -AC_PROG_CC -AM_PROG_AR -AM_PROG_CC_C_O -AC_PROG_LIBTOOL -AC_OUTPUT -EOF - -cat > Makefile.am <<'EOF' -# Need generic and non-generic rules. -lib_LTLIBRARIES = libfoo.la libbar.la -libbar_la_CFLAGS = $(AM_CFLAGS) -SUBDIRS = sub -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -lib_LTLIBRARIES = libbaz.la libbla.la -libbla_la_CFLAGS = $(AM_CFLAGS) -EOF - -cat > libfoo.c <<'EOF' -int main () -{ - return 0; -} -EOF -cp libfoo.c libbar.c -cp libfoo.c sub/libbaz.c -cp libfoo.c sub/libbla.c - -libtoolize -$ACLOCAL -$AUTOMAKE --add-missing -$AUTOCONF - -./configure am_cv_CC_dependencies_compiler_type=gcc --enable-silent-rules -$MAKE >stdout || { cat stdout; exit 1; } -cat stdout -$EGREP ' (-c|-o)' stdout && exit 1 -grep 'mv ' stdout && exit 1 -grep ' CC .*foo\.' stdout -grep ' CC .*bar\.' stdout -grep ' CC .*baz\.' stdout -grep ' CC .*bla\.' stdout -grep ' CCLD .*foo' stdout -grep ' CCLD .*bar' stdout -grep ' CCLD .*baz' stdout -grep ' CCLD .*bla' stdout - -$MAKE clean -$MAKE V=1 >stdout || { cat stdout; exit 1; } -cat stdout -grep ' -c' stdout -grep ' -o libfoo' stdout -# The libtool command line can contain e.g. a '--tag=CC' option. -sed 's/--tag=[^ ]*/--tag=x/g' stdout | $EGREP '(CC|LD) ' && exit 1 - -: diff --git a/t/silent-lt-generic.sh b/t/silent-lt.sh similarity index 94% rename from t/silent-lt-generic.sh rename to t/silent-lt.sh index 013460334..28a4f8900 100755 --- a/t/silent-lt-generic.sh +++ b/t/silent-lt.sh @@ -14,9 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check silent-rules mode, with libtool, standard depmode case. - -# Please keep this file in sync with 'silent-lt-gcc.sh'. +# Check silent-rules mode for C, with libtool, both with and without +# automatic dependency tracking. required='cc libtoolize' . test-init.sh diff --git a/t/silent-many-gcc.sh b/t/silent-many-gcc.sh deleted file mode 100755 index e810e27c7..000000000 --- a/t/silent-many-gcc.sh +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh -# Copyright (C) 2009-2012 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 . - -# Check silent-rules mode, with gcc depmode and many languages at once. -# This test partly overlaps with other 'silent*.sh', but it serves as -# a stress test by using many different languages at once -- so don't -# remove this test script. -# This test requires the GNU compilers; keep it in sync with sister test -# 'silent-many-generic.sh', which should work with generic compilers. - -required='gcc g++ gfortran lex yacc' -. test-init.sh - -# Avoids too much code duplication. -do_and_check_silent_build () -{ - case $1 in - --rebuild) rebuild=true;; - *) rebuild=false;; - esac - - $MAKE >stdout || { cat stdout; exit 1; } - cat stdout - # Avoid spurious failures with SunStudio Fortran compilers. - sed '/^NOTICE:/d' stdout > t - mv -f t stdout - cat stdout - - $EGREP ' (-c|-o)' stdout && exit 1 - $EGREP '(mv|ylwrap) ' stdout && exit 1 - - grep 'CXX .*foo1\.' stdout - grep 'CXX .*baz1\.' stdout - grep 'FC .*foo2\.' stdout - grep 'FC .*baz2\.' stdout - grep 'F77 .*foo3\.' stdout - grep 'F77 .*baz3\.' stdout - grep ' CC .*foo5\.' stdout - grep ' CC .*baz5\.' stdout - grep ' CC .*foo6\.' stdout - grep ' CC .*baz6\.' stdout - - grep 'CXXLD .*foo' stdout - grep 'CCLD .*bar' stdout - grep 'CXXLD .*baz' stdout - grep 'CCLD .*bla' stdout - - if ! $rebuild; then - grep 'YACC .*foo6\.' stdout - grep 'YACC .*baz6\.' stdout - grep 'LEX .*foo5\.' stdout - grep 'LEX .*baz5\.' stdout - fi - - unset rebuild -} - -# Avoids too much code duplication. -do_and_check_verbose_build () -{ - case $1 in - --rebuild) rebuild=true;; - *) rebuild=false;; - esac - - $MAKE V=1 >stdout || { cat stdout; exit 1; } - cat stdout - - grep ' -c ' stdout - grep ' -o ' stdout - - $EGREP '(CC|CXX|FC|F77|LD) ' stdout && exit 1 - - if ! $rebuild; then - grep 'ylwrap ' stdout - $EGREP '(LEX|YACC) ' stdout && exit 1 - fi - - unset rebuild -} - -mkdir sub - -cat >>configure.ac <<'EOF' -AM_PROG_CC_C_O -AC_PROG_CXX -AC_PROG_F77 -AC_PROG_FC -AC_PROG_LEX -AC_PROG_YACC -AC_CONFIG_FILES([sub/Makefile]) -AC_OUTPUT -EOF - -cat > Makefile.am <<'EOF' -# Need generic and non-generic rules. -bin_PROGRAMS = foo bar fo2 -bar_CFLAGS = $(AM_CFLAGS) -foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y -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) -BUILT_SOURCES = foo6.h -EOF - -cat > sub/Makefile.am <<'EOF' -AUTOMAKE_OPTIONS = subdir-objects -# Need generic and non-generic rules. -bin_PROGRAMS = baz bla ba2 -bla_CFLAGS = $(AM_CFLAGS) -baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y -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 -EOF - -cat > foo1.cpp <<'EOF' -int main () -{ - return 0; -} -EOF -cat > foo2.f90 <<'EOF' - subroutine foo2 - return - end -EOF -cat > foo3.f <<'EOF' - subroutine foo3 - return - end -EOF -cat > foo5.l <<'EOF' -%{ -#define YY_NO_UNISTD_H 1 -%} -%% -"END" return EOF; -. -%% -/* Avoid possible link errors. */ -int yywrap (void) -{ - return 1; -} -EOF -cat > foo6.y <<'EOF' -%{ -void yyerror (char *s) {} -%} -%token EOF -%% -fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {}; -EOF -cp foo1.cpp bar.c -cp foo1.cpp sub/baz.c -cp foo1.cpp sub/bla.c -cp foo1.cpp sub/baz1.cpp -cp foo2.f90 sub/baz2.f90 -cp foo3.f sub/baz3.f -cp foo5.l sub/baz5.l -cp foo6.y sub/baz6.y - -$ACLOCAL -$AUTOMAKE --add-missing -$AUTOCONF - -# Sanity check: make sure the cache variables we force are really -# used by configure. -$FGREP am_cv_CC_dependencies_compiler_type configure -$FGREP am_cv_CXX_dependencies_compiler_type configure -# 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. -depmodes="am_cv_CC_dependencies_compiler_type=gcc \ - am_cv_CXX_dependencies_compiler_type=gcc" -# This apparently useless "for" loop is here to simplify the syncing -# with sister test 'silent-many-generic.sh'. -for config_args in \ - "$depmodes" -do - - ./configure $config_args --enable-silent-rules - - do_and_check_silent_build - # 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 - do_and_check_silent_build --rebuild - - # Ensure a clean rebuild. - $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] - - do_and_check_verbose_build - # 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 - do_and_check_verbose_build --rebuild - - # Ensure a clean reconfiguration/rebuild. - $MAKE clean - $MAKE maintainer-clean - -done - -: diff --git a/t/silent-many-generic.sh b/t/silent-many-languages.sh similarity index 97% rename from t/silent-many-generic.sh rename to t/silent-many-languages.sh index 6e8c33b5f..c8954d135 100755 --- a/t/silent-many-generic.sh +++ b/t/silent-many-languages.sh @@ -18,9 +18,6 @@ # This test partly overlaps with other 'silent*.sh', but it serves as # a stress test by using many different languages at once -- so don't # remove this test script. -# This test should work with generic compilers; keep it in sync with -# sister test 'silent-many-gcc.sh', which requires the GNU compilers -# and forces the use of gcc depmode. required='cc c++ fortran fortran77 lex yacc' . test-init.sh