If the concern is making certain that new Perl warnings are noticed, 
    simply putting PERL5OPT='-Mwarnings=FATAL,all' in the environment when 
    running the testsuite should accomplish that.

Thanks for the suggestion. I put a note into HACKING about it.

I also tried running the tests that way, and discovered one intentional
warning in t/parallel-tests-log-compiler-example.sh (and so the test
failed). I added an explicit "use warnings" there to override the envvar
setting. -k

-----------------------------------------------------------------------------
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.
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/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

Running command: git commit \-q \-F \.\/vc\-dwim\-log\-3EzXBh \-\-author\=Karl\ 
Berry\ \<karl\@freefriends\.org\> \-\- ChangeLog
+ set +x

compile finished at Tue Feb  4 08:22:26 2025

Reply via email to