From: Stefano Lattarini Date: Tue, 27 Apr 2010 00:12:50 +0000 (+0200) Subject: Improved test silent5.test. X-Git-Tag: v1.11.1b~82^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de09b369b135b971bffb0efe383716237b9bf7f1;p=thirdparty%2Fautomake.git Improved test silent5.test. * tests/silent5.test: Remove by hand all generated C files after non-verbose builds, to ensure the following builds are clean. Try to clean and rebuild with the same verbosity and without removing generated sources in between, to check that this does not trigger a different set of rules. Make grepping of make's output stricter. Improved/added some comments. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 1fb4ba8c5..ad4f61703 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-06-06 Stefano Lattarini + Improved test silent5.test. + * tests/silent5.test: Remove by hand all generated C files after + non-verbose builds, to ensure the following builds are clean. + Try to clean and rebuild with the same verbosity and without + removing generated sources in between, to check that this does + not trigger a different set of rules. Make grepping of make's + output stricter. Improved/added some comments. + New tests for Automake silent-mode with Fortran. * tests/silentf77.test: New test. * tests/silentf90.test: Likewise. diff --git a/tests/silent5.test b/tests/silent5.test index dfddb58a1..e1134e864 100755 --- a/tests/silent5.test +++ b/tests/silent5.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010 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 @@ -15,12 +15,81 @@ # along with this program. If not, see . # Check silent-rules mode, languages other than C. +# This test partly overlaps with other silent*.test, but it serves as +# a stress test by using many different languages at once -- so don't +# remove this test script. +# FIXME: generic C++/Fortran compilers should suffice here required='g++ gfortran flex bison' . ./defs set -e +# 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 + + $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 :; else + 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 + + grep '(CC|CXX|FC|F77|LD) ' stdout && Exit 1 + + if $rebuild; then :; else + grep 'ylwrap ' stdout + grep '(LEX|YACC) ' stdout && Exit 1 + fi + + unset rebuild +} + mkdir sub cat >>configure.in <<'EOF' @@ -109,63 +178,38 @@ $AUTOMAKE --add-missing $AUTOCONF # configure once for fastdep, once for non-fastdep, once for nodep -for config_args in '' am_cv_CC_dependencies_compiler_type=gcc \ +for config_args in \ + '' \ + am_cv_CC_dependencies_compiler_type=gcc \ --disable-dependency-tracking do - ./configure $config_args --enable-silent-rules - $MAKE >stdout || { cat stdout; Exit 1; } - cat stdout - grep ' -c' stdout && Exit 1 - grep ' -o ' stdout && Exit 1 - grep 'mv ' 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 'LEX .*foo5\.' stdout - grep 'LEX .*baz5\.' stdout - grep ' CC .*foo5\.' stdout - grep ' CC .*baz5\.' stdout - grep 'YACC .*foo6\.' stdout - grep 'YACC .*baz6\.' stdout - grep ' CC .*foo6\.' stdout - grep ' CC .*baz6\.' stdout + ./configure $config_args --enable-silent-rules - grep 'CXXLD .*foo' stdout - grep 'CCLD .*bar' stdout - grep 'CXXLD .*baz' stdout - grep 'CCLD .*bla' stdout + 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 - $MAKE V=1 >stdout || { cat stdout; Exit 1; } - cat stdout - grep ' -c' stdout - grep ' -o ' stdout + # 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 - grep 'CXX .*foo1\.' stdout && Exit 1 - grep 'CXX .*baz1\.' stdout && Exit 1 - grep 'FC .*foo2\.' stdout && Exit 1 - grep 'FC .*baz2\.' stdout && Exit 1 - grep 'F77 .*foo3\.' stdout && Exit 1 - grep 'F77 .*baz3\.' stdout && Exit 1 - grep 'LEX .*foo5\.' stdout && Exit 1 - grep 'LEX .*baz5\.' stdout && Exit 1 - grep ' CC .*foo5\.' stdout && Exit 1 - grep ' CC .*baz5\.' stdout && Exit 1 - grep 'YACC .*foo6\.' stdout && Exit 1 - grep 'YACC .*baz6\.' stdout && Exit 1 - grep ' CC .*foo6\.' stdout && Exit 1 - grep ' CC .*baz6\.' stdout && Exit 1 - - grep 'CXXLD .*foo' stdout && Exit 1 - grep 'CCLD .*bar' stdout && Exit 1 - grep 'CXXLD .*baz' stdout && Exit 1 - grep 'CCLD .*bla' stdout && Exit 1 + # Ensure a clean reconfiguration/rebuild. $MAKE clean $MAKE maintainer-clean + done :