perl-Test-Spec
perl-Test-Spec copied to clipboard
When there are no matchers all tests are filtered out
When this happens it looks like this:
1..0
skipped: (no reason given)
Test Summary Report
-------------------
t/foo.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Files=1, Tests=0, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.15 cusr 0.03 csys = 0.22 CPU)
Result: FAIL
This patch makes it work:
--- /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/Test/Spec.pm.orig 2021-04-12 11:54:06.169488566 -0500
+++ /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/Test/Spec.pm 2021-04-12 11:54:40.216941063 -0500
@@ -147,7 +147,8 @@
sub _pick_tests {
my ($class,@matchers) = @_;
my @tests = $class->tests;
-
+ return @tests if !@matchers;
+
my $pattern = join("|", @matchers);
@tests = grep { $_->name =~ /$pattern/i } @tests;
Still looking into why this happens for some test files and not others.