Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test::Strict: t/01all.t fails on perl-5.37.3 #32

Open
jkeenan opened this issue Sep 5, 2022 · 1 comment
Open

Test::Strict: t/01all.t fails on perl-5.37.3 #32

jkeenan opened this issue Sep 5, 2022 · 1 comment

Comments

@jkeenan
Copy link

jkeenan commented Sep 5, 2022

A change in Perl 5 blead has begun to cause a test failure in this distribution's test suite. The failure looks like this:

$ bleadprove -vb t/01all.t 
t/01all.t .. 
1..59
...
not ok 54 - Syntax check /tmp/4ja1UjrJvU/AWX5AatGfR.pl

#   Failed test 'Syntax check /tmp/4ja1UjrJvU/AWX5AatGfR.pl'
#   at /usr/home/jkeenan/.cpan/build/Test-Strict-0.52-0/blib/lib/Test/Strict.pm line 435.
# 
# This is perl 5, version 37, subversion 4 (v5.37.4 (v5.37.2-418-g8975221916)) built for amd64-freebsd-thread-multi
# 
# Copyright 1987-2022, Larry Wall
# 
# Perl may be copied only under the terms of either the Artistic License or the
# GNU General Public License, which may be found in the Perl 5 source kit.
# 
# Complete documentation for Perl, including FAQ lists, should be found on
# this system using "man perl" or "perldoc perl".  If you have access to the
# Internet, point your browser at https://www.perl.org/, the Perl Home Page.
# 

This problem was first reported to Perl 5's issue tracker as Perl/perl5#20252. Preliminary discussion suggests need to modify t/01all.t .

Can you investigate?

Thank you very much.
Jim Keenan

@demerphq
Copy link

demerphq commented Sep 5, 2022

To explain more, testing code with -c that uses -vw on the shebang line is a mistake, it is a bug that INIT blocks ran after BEGIN did an exit, which how -v is implemented. So before you could check the version AND compile the code at the same time, now you can only do one of the two.

jkeenan added a commit to jkeenan/Test-Strict that referenced this issue Jan 14, 2023
Up through perl-5.37.3, there was a bug in perl (see
Perl/perl5#20252 (comment))
which permitted simultaneous use of the '-c' and '-v' switches to the
perl interpreter.  Once this bug was corrected, t/01all.t began to fail.
As Test::Strict has many CPAN distributions depending on it, this test
failure has had wide impact.

This pull request modifies tests appropriately and has been tested on
bleadperl (v5.37.7-134-g25948dfb24) and on perl-5.32.1, in both cases on
threaded builds on FreeBSD-12.  Devel::Cover was not installed on
bleadperl, hence t/04cover.t was skipped on that build.  Otherwise, all
tests are passing.  In the course of testing, certain additions were
made to .gitignore and MANIFEST.SKIP to get metadata-oriented tests to
pass.

NOTE:  In my git checkout I find the following file:

        .git/hooksfsmonitor-watchman.sample

This is deemed by 'file' to be a Perl executable.  As such, it is pushed
onto the list of files tested by 'all_perl_files_ok()' at the start of
t/01all.t.  This in turn means that in my 'git checkout' the count of
tests is off by 2 and the test is reported to fail.

        "Looks like you planned 59 tests but ran 61."

Because the files in .git/hooks/ should not be included in the tarball,
the count of tests is correct when run from the tarball.  I leave to the
maintainer to determine how to square this circle.  You should probably
check for the presence of a .git/ directory and exclude that directory
from the list of directories passed to all_perl_files_ok().

For manwar#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants