diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-04-11 21:30:34 +0200 |
---|---|---|
committer | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2010-04-11 21:30:34 +0200 |
commit | f7587e184a52785913eda87fbb6ff6f0bc2aeb29 (patch) | |
tree | 9563b309cdab2fbab077eadcdc9bfe7a2db81ef3 | |
parent | bda8d57b6af0bf3dfe2524514304856a16766b7d (diff) | |
download | automake-f7587e184a52785913eda87fbb6ff6f0bc2aeb29.tar.gz |
Ensure we don't print 'warning:' or 'error:' twice.
* Makefile.am (sc_ensure_testsuite_has_run): New helper rule.
(sc_tests_logs_duplicate_prefixes): New rule, to check for
wrong-looking warning and error messages in the test suite logs.
* aclocal.in (scan_configure_dep, scan_file): Remove duplicate
`warning: ' prefix.
* tests/vars3.test: Rename variable to avoid false positive.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.am | 19 | ||||
-rw-r--r-- | Makefile.in | 14 | ||||
-rw-r--r-- | aclocal.in | 6 | ||||
-rwxr-xr-x | tests/vars3.test | 6 |
5 files changed, 47 insertions, 6 deletions
@@ -1,5 +1,13 @@ 2010-04-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + Ensure we don't print 'warning:' or 'error:' twice. + * Makefile.am (sc_ensure_testsuite_has_run): New helper rule. + (sc_tests_logs_duplicate_prefixes): New rule, to check for + wrong-looking warning and error messages in the test suite logs. + * aclocal.in (scan_configure_dep, scan_file): Remove duplicate + `warning: ' prefix. + * tests/vars3.test: Rename variable to avoid false positive. + Prepend type to warning, error, and fatal messages. For the first part of messages of types `error' or `fatal', prepend `error: ' to the message. Prepend `warning: ' to diff --git a/Makefile.am b/Makefile.am index 6c24285eb..f5ab44fb0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -190,6 +190,7 @@ sc_tests_required_after_defs \ sc_tests_overriding_macros_on_cmdline \ sc_tests_plain_sleep \ sc_tests_plain_egrep_fgrep \ +sc_tests_logs_duplicate_prefixes \ sc_mkdir_p \ sc_perl_at_substs \ sc_unquoted_DESTDIR \ @@ -458,6 +459,24 @@ sc_tests_plain_egrep_fgrep: exit 1; \ fi +## Rule to ensure that the testsuite has been run before. We don't depend on `check' +## here, because that would be very wasteful in the common case. We could run +## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS. +sc_ensure_testsuite_has_run: + @if test ! -f tests/test-suite.log; then \ + echo "Run \`make check' before \`maintainer-check'" >&2; \ + exit 1; \ + fi +.PHONY: sc_ensure_testsuite_has_run + +## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes. +## This test actually depends on the testsuite having been run before; but it would be +sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run + @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \ + echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \ + exit 1; \ + fi + sc_mkdir_p: @if grep 'mkdir_p' $(srcdir)/automake.in \ $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \ diff --git a/Makefile.in b/Makefile.in index d8e60c0fe..15d81ba8d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -312,6 +312,7 @@ sc_tests_required_after_defs \ sc_tests_overriding_macros_on_cmdline \ sc_tests_plain_sleep \ sc_tests_plain_egrep_fgrep \ +sc_tests_logs_duplicate_prefixes \ sc_mkdir_p \ sc_perl_at_substs \ sc_unquoted_DESTDIR \ @@ -1180,6 +1181,19 @@ sc_tests_plain_egrep_fgrep: exit 1; \ fi +sc_ensure_testsuite_has_run: + @if test ! -f tests/test-suite.log; then \ + echo "Run \`make check' before \`maintainer-check'" >&2; \ + exit 1; \ + fi +.PHONY: sc_ensure_testsuite_has_run + +sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run + @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \ + echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \ + exit 1; \ + fi + sc_mkdir_p: @if grep 'mkdir_p' $(srcdir)/automake.in \ $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \ diff --git a/aclocal.in b/aclocal.in index dc8476294..9622711a7 100644 --- a/aclocal.in +++ b/aclocal.in @@ -435,7 +435,7 @@ sub scan_configure_dep ($) # Make this just a warning, because we do not know whether # the macro is actually used (it could be called conditionally). msg ('unsupported', "$file:$line", - "warning: macro `$2' not found in library"); + "macro `$2' not found in library"); } } @@ -507,7 +507,7 @@ sub scan_file ($$$) if ($number !~ /$serial_number_rx/go) { msg ('syntax', "$file:$.", - "warning: ill-formed serial number `$number', " + "ill-formed serial number `$number', " . "expecting a version string with only digits and dots"); } elsif ($defun_seen) @@ -559,7 +559,7 @@ sub scan_file ($$$) $defun_seen = 1; if (! defined $1) { - msg ('syntax', "$file:$.", "warning: underquoted definition of $2" + msg ('syntax', "$file:$.", "underquoted definition of $2" . "\n run info '(automake)Extending aclocal'\n" . " or see http://sources.redhat.com/automake/" . "automake.html#Extending-aclocal") diff --git a/tests/vars3.test b/tests/vars3.test index 3d10a902d..3f61c90d4 100755 --- a/tests/vars3.test +++ b/tests/vars3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002, 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 @@ -30,7 +30,7 @@ L05 = "$(bad boy)" L06 = $(this:is= ok) L07 = ${three errors}${on this} $(long line) L08$(o u c h): $(wildcard *.c) - ${another error} + ${another Error} echo $${ok-this is} L11: $(thisis) $(ok) ${here} @@ -69,7 +69,7 @@ grep 'on this' stderr grep 'long line' stderr grep 'o u c h' stderr grep 'wildcard' stderr -grep 'another error' stderr +grep 'another Error' stderr grep 'thisis' stderr && Exit 1 grep 'here' stderr && Exit 1 |