From 92f83bdb4f3122a4dcbb10b2a89b5b52ab2b82b6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 4 Feb 2025 08:22:26 -0800 Subject: [PATCH] test: allow running with fatal warnings given in PERL5OPT. * HACKING: mention running the test suite with PERL5OPT=-Mwarnings=FATAL,all in the environment at new Perl (and Automake releases), to try to keep up with new Perl warnings. Suggestion from Jacob Bachmeyer, https://lists.gnu.org/archive/html/automake/2025-02/msg00001.html * t/parallel-tests-log-compiler-example.sh: explicitly use warnings so that this PERL5OPT setting won't be a fatal error. * NEWS: formatting. --- HACKING | 10 ++++++++-- NEWS | 6 ++++-- t/parallel-tests-log-compiler-example.sh | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/HACKING b/HACKING index 81f7bffce..ea06d1d85 100644 --- a/HACKING +++ b/HACKING @@ -144,7 +144,7 @@ The use of & prevents prototypes from being checked; it's also uncommon in modern Perl code. (Perl prototypes are unlike function prototypes in other - languages, so understand what they do.) + languages, so understand what they do. They are not required.) * For automake.texi: - After and during editing, run make info for error checking, and make pdf @@ -378,9 +378,15 @@ * Use Perl coverage information to ensure your new code is thoroughly tested by your new tests. +* When there is a new Perl release, and at Automake releases, run the + tests with PERL5OPT=-Mwarnings=FATAL,all in the environment. This + makes Perl warnings into fatal errors, which will (presumably) cause + tests to fail when Perl gives a new warning for something in our code. + * To run the tests, you should install expect, shar, language compilers, gettext macros. Anything you don't install won't be tested. The test suite will report on tests skipped due to software not available. + Look at the list and install anything feasible. * Run the test suite in parallel (e.g., "make -j12 check"), both so it doesn't take forever and because that is what most users will do. You @@ -415,7 +421,7 @@ pushing a commit, since that exercises yet more of the code. * To unsilence Automake's "pretty" output for debugging, see the - "Unsilencing Automake" node in the manual. In short: run make --debug=p. + "Unsilencing Automake" node in the manual; in short, run make --debug=p. For the Automake test suite in particular, add VERBOSE=1. * To set up a new test, first write the test file in t/good-name.sh. diff --git a/NEWS b/NEWS index 058b73f04..f667c8727 100644 --- a/NEWS +++ b/NEWS @@ -15,9 +15,11 @@ New in 1.x: * Bugs fixed - - do not make Perl warnings fatal, per Perl's recommendation. + - Do not make Perl warnings fatal, per Perl's recommendation. - - avoid Perl 5.41.8+ precedence warning for use of !!. + - Avoid Perl 5.41.8+ precedence warning for use of !!. + + - The compile script is more robust to various Windows configurations. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/t/parallel-tests-log-compiler-example.sh b/t/parallel-tests-log-compiler-example.sh index 97d365771..fa8f97fcb 100644 --- a/t/parallel-tests-log-compiler-example.sh +++ b/t/parallel-tests-log-compiler-example.sh @@ -37,7 +37,10 @@ LOG_COMPILER = ./wrapper-script AM_LOG_FLAGS = -d END -echo 'my $a =+ 2; exit (0);' > foo.pl +# intentionally reversed += operator to provoke warning; thus, +# explicitly use warnings so that PERL5OPT=-Mwarnings=FATAL,all +# in the environment won't be a fatal error. See ../HACKING. +echo 'use warnings; my $a =+ 2; exit (0);' > foo.pl echo 'import sys; sys.exit(0);' > bar.py : > baz -- 2.47.3