Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Test-Compile for openSUSE:Factory checked in at 2023-04-03 17:47:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Compile (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Compile.new.9019 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Compile" Mon Apr 3 17:47:25 2023 rev:16 rq:1077001 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Compile/perl-Test-Compile.changes 2022-06-16 18:22:29.764274840 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-Compile.new.9019/perl-Test-Compile.changes 2023-04-03 17:47:39.190918035 +0200 @@ -1,0 +2,14 @@ +Mon Apr 3 03:08:47 UTC 2023 - Tina Müller <timueller+p...@suse.de> + +- updated to 3.2.0 + see /usr/share/doc/packages/perl-Test-Compile/Changes + + v3.2.0 2023-04-03 + - Sort the output of all_pl_files() and all_pm_files() + + v3.1.1 2023-03-28 + - Proof read and correct the POD + - Be more consistent about where we search for files (by default) + - Update copyright (2023) + +------------------------------------------------------------------- Old: ---- Test-Compile-v3.1.0.tar.gz New: ---- Test-Compile-v3.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Compile.spec ++++++ --- /var/tmp/diff_new_pack.5KXLeE/_old 2023-04-03 17:47:39.690921720 +0200 +++ /var/tmp/diff_new_pack.5KXLeE/_new 2023-04-03 17:47:39.698921779 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-Compile # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define cpan_name Test-Compile Name: perl-Test-Compile -Version: 3.1.0 +Version: 3.2.0 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Assert that your Perl files compile OK ++++++ Test-Compile-v3.1.0.tar.gz -> Test-Compile-v3.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/Changes new/Test-Compile-v3.2.0/Changes --- old/Test-Compile-v3.1.0/Changes 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/Changes 2023-04-02 22:14:39.000000000 +0200 @@ -1,5 +1,13 @@ Revision history for Perl extension Test-Compile +v3.2.0 2023-04-03 + - Sort the output of all_pl_files() and all_pm_files() + +v3.1.1 2023-03-28 + - Proof read and correct the POD + - Be more consistent about where we search for files (by default) + - Update copyright (2023) + v3.1.0 2022-06-02 - (Tom Hukins) Treat files with .psgi extensions as perl - (Tom Hukins) Look for file in a case insensitive manner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/MANIFEST new/Test-Compile-v3.2.0/MANIFEST --- old/Test-Compile-v3.1.0/MANIFEST 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/MANIFEST 2023-04-02 22:14:39.000000000 +0200 @@ -12,7 +12,9 @@ t/100-internal--find-files-ignores-cvs.t t/100-internal--find-files-ignores-svn.t t/100-internal--find-files.t -t/100-internal--is-in-taint-mode.t +t/100-internal--taint-mode.t +t/100-internal--perl-module.t +t/100-internal--perl-script.t t/100-internal--read-shebang.t t/100-internal--skip.t t/100-internal--test-methods.t @@ -37,13 +39,14 @@ t/999-portability.t t/999-synopsis.t t/999-version.t +t/perlcriticrc t/scripts/.svn/Ignore.pm t/scripts/CVS/Ignore.pm t/scripts/CVS/taint2.pl t/scripts/datafile t/scripts/failure.pl t/scripts/LethalImport.pm -t/scripts/lib.pl +t/scripts/messWithLib.pl t/scripts/Module2.pm t/scripts/Module.pm t/scripts/perlscript diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/META.json new/Test-Compile-v3.2.0/META.json --- old/Test-Compile-v3.1.0/META.json 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/META.json 2023-04-02 22:14:39.000000000 +0200 @@ -31,11 +31,11 @@ "provides" : { "Test::Compile" : { "file" : "lib/Test/Compile.pm", - "version" : "v3.1.0" + "version" : "v3.2.0" }, "Test::Compile::Internal" : { "file" : "lib/Test/Compile/Internal.pm", - "version" : "v3.1.0" + "version" : "v3.2.0" } }, "release_status" : "stable", @@ -47,6 +47,6 @@ "url" : "http://github.com/egiles/test-compile" } }, - "version" : "v3.1.0", + "version" : "v3.2.0", "x_serialization_backend" : "JSON::PP version 4.04" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/META.yml new/Test-Compile-v3.2.0/META.yml --- old/Test-Compile-v3.1.0/META.yml 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/META.yml 2023-04-02 22:14:39.000000000 +0200 @@ -16,10 +16,10 @@ provides: Test::Compile: file: lib/Test/Compile.pm - version: v3.1.0 + version: v3.2.0 Test::Compile::Internal: file: lib/Test/Compile/Internal.pm - version: v3.1.0 + version: v3.2.0 requires: Exporter: '5.68' parent: '0.225' @@ -27,5 +27,5 @@ resources: license: http://dev.perl.org/licenses/ repository: http://github.com/egiles/test-compile -version: v3.1.0 +version: v3.2.0 x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/README new/Test-Compile-v3.2.0/README --- old/Test-Compile-v3.1.0/README 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/README 2023-04-02 22:14:39.000000000 +0200 @@ -19,7 +19,7 @@ ./Build install COPYRIGHT AND LICENSE - Copyright 2007-2021. + Copyright 2007-2023. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/lib/Test/Compile/Internal.pm new/Test-Compile-v3.2.0/lib/Test/Compile/Internal.pm --- old/Test-Compile-v3.1.0/lib/Test/Compile/Internal.pm 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/lib/Test/Compile/Internal.pm 2023-04-02 22:14:39.000000000 +0200 @@ -3,8 +3,8 @@ use warnings; use strict; -use version; our $VERSION = version->declare("v3.1.0"); -use File::Spec; +use version; our $VERSION = version->declare("v3.2.0"); +use File::Find; use Test::Builder; use IPC::Open3 (); @@ -85,7 +85,7 @@ my $ok = 1; for my $file ( $self->all_pm_files(@dirs) ) { my $testok = $self->pm_file_compiles($file); - $ok = $testok ? $ok : 0; + $ok = $testok ? $ok : 0; $test->ok($testok, "$file compiles"); } return $ok; @@ -109,7 +109,7 @@ my $ok = 1; for my $file ( $self->all_pl_files(@dirs) ) { my $testok = $self->pl_file_compiles($file); - $ok = $testok ? $ok : 0; + $ok = $testok ? $ok : 0; $test->ok($testok, "$file compiles"); } return $ok; @@ -144,24 +144,23 @@ If you provide a list of C<@dirs>, it'll use that as a list of files to process, or directories to search for perl modules. -If you don't provide C<dirs>, it'll search for perl modules in the F<blib> directory, -unless that directory doesn't exist, in which case it'll search the F<lib> directory. +If you don't provide C<dirs>, it'll search for perl modules in the F<blib/lib> directory, +if that directory exists, otherwise it'll search the F<lib> directory. Skips any files in F<CVS>, F<.svn>, or F<.git> directories. -The order of the files returned is machine-dependent. If you want them -sorted, you'll have to sort them yourself. - =cut sub all_pm_files { my ($self, @dirs) = @_; - @dirs = @dirs ? @dirs : _pm_starting_points(); + @dirs = @dirs ? @dirs : $self->_default_locations('lib'); my @pm; for my $file ( $self->_find_files(@dirs) ) { - push @pm, $file if $file =~ /\.pm$/; + if ( $self->_perl_module($file) ) { + push @pm, $file; + } } return @pm; } @@ -175,34 +174,23 @@ directories to search for perl scripts. If you don't provide C<dirs>, it'll search for perl scripts in the F<blib/script/> -directory, or if that doesn't exist, the F<script/> directory, or if that doesn't exist, -the F<bin/> directory. +and F<blib/bin/> directories if F<blib> exists, otherwise it'll search the F<script/> +and F<bin/> directories Skips any files in F<CVS>, F<.svn>, or F<.git> directories. -The order of the files returned is machine-dependent. If you want them -sorted, you'll have to sort them yourself. - =cut sub all_pl_files { my ($self, @dirs) = @_; - @dirs = @dirs ? @dirs : _pl_starting_points(); + @dirs = @dirs ? @dirs : $self->_default_locations('script', 'bin'); my @pl; for my $file ( $self->_find_files(@dirs) ) { - if ( $file =~ /\.p(?:l|sgi)$/i ) { - # Files with .pl or .psgi extensions are perl scripts + if ( $self->_perl_script($file) ) { push @pl, $file; } - elsif ( $file =~ /(?:^[^.]+$)/ ) { - # Files with no extension, but a perl shebang are perl scripts - my $shebang = $self->_read_shebang($file); - if ( $shebang =~ m/perl/ ) { - push @pl, $file; - } - } } return @pl; } @@ -321,7 +309,7 @@ my $output; for my $handle ( $stdout, $stderr ) { - if ( $handle ) { + if ( $handle ) { while ( my $line = <$handle> ) { push @$output, $line; } @@ -339,28 +327,19 @@ sub _find_files { my ($self, @searchlist) = @_; - my @output; - for my $file (@searchlist) { - if (defined($file) && -f $file) { - push @output, $file; - } elsif (defined($file) && -d $file) { - local *DH; - opendir DH, $file or next; - my @newfiles = readdir DH; - closedir DH; - @newfiles = File::Spec->no_upwards(@newfiles); - @newfiles = grep { $_ ne "CVS" && $_ ne ".svn" && $_ ne ".git" } @newfiles; - for my $newfile (@newfiles) { - my $filename = File::Spec->catfile($file, $newfile); - if (-f $filename) { - push @output, $filename; - } else { - push @searchlist, File::Spec->catdir($file, $newfile); - } + my @filelist; + my $findfunc = sub { + my $fname = $File::Find::name; + if ( -f $fname ) { + if ( !($fname =~ m/CVS|\.svn|\.git/) ) { + push @filelist, $fname; } } - } - return @output; + }; + + no warnings 'File::Find'; + find({wanted => $findfunc, no_chdir => 1}, @searchlist); + return (sort @filelist); } # Check the syntax of a perl file @@ -372,8 +351,8 @@ return 0; } - my @inc = ('blib/lib', @INC); - my $taint = $self->_is_in_taint_mode($file); + my @inc = (File::Spec->catdir("blib", "lib"), @INC); + my $taint = $self->_taint_mode($file); my $command = join(" ", (qq{"$^X"}, (map { qq{"-I$_"} } @inc), "-c$taint", $file)); if ( $self->verbose() ) { $self->{test}->diag("Executing: " . $command); @@ -390,17 +369,19 @@ return $compiles; } -# Where do we expect to find perl modules? -sub _pm_starting_points { - return 'blib' if -e 'blib'; - return 'lib'; -} +# Where do we expect to find perl files? +sub _default_locations { + my ($self, @dirs) = @_; -# Where do we expect to find perl programs? -sub _pl_starting_points { - return 'blib/script' if -e 'blib/script'; - return 'script' if -e 'script'; - return 'bin' if -e 'bin'; + my @locations = (); + my $prefix = -e 'blib' ? "blib" : "."; + for my $dir ( @dirs ) { + my $location = File::Spec->catfile($prefix, $dir); + if ( -e $location ) { + push @locations, $location; + } + } + return @locations; } # Extract the shebang line from a perl program @@ -415,7 +396,7 @@ } # Should the given file be checked with taint mode on? -sub _is_in_taint_mode { +sub _taint_mode { my ($self, $file) = @_; my $shebang = $self->_read_shebang($file); @@ -426,6 +407,33 @@ return $taint; } +# Does this file look like a perl script? +sub _perl_script { + my ($self, $file) = @_; + + # Files with .pl or .psgi extensions are perl scripts + if ( $file =~ /\.p(?:l|sgi)$/i ) { + return 1; + } + + # Files with no extension, but a perl shebang are perl scripts + if ( $file =~ /(?:^[^.]+$)/ ) { + my $shebang = $self->_read_shebang($file); + if ( $shebang =~ m/perl/ ) { + return 1; + } + } +} + +# Does this file look like a perl module? +sub _perl_module { + my ($self, $file) = @_; + + if ( $file =~ /\.pm$/ ) { + return 1; + } +} + 1; =head1 AUTHORS @@ -436,7 +444,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright 2007-2021 by the authors. +Copyright 2007-2023 by the authors. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -446,4 +454,7 @@ L<Test::Strict> provides functions to ensure your perl files compile, with the added bonus that it will check you have used strict in all your files. +L<Test::LoadAllModules> just handles modules, not script files, but has more +fine-grained control. + =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/lib/Test/Compile.pm new/Test-Compile-v3.2.0/lib/Test/Compile.pm --- old/Test-Compile-v3.1.0/lib/Test/Compile.pm 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/lib/Test/Compile.pm 2023-04-02 22:14:39.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use strict; -use version; our $VERSION = version->declare("v3.1.0"); +use version; our $VERSION = version->declare("v3.2.0"); use parent 'Exporter'; use Test::Compile::Internal; @@ -114,16 +114,16 @@ The use of the following functions is deprecated and strongly discouraged. +Instead, you should use the object oriented interface described in the L</SYNOPSIS> +and in L<Test::Compile::Internal>. + They are automatically exported to your namespace, which is no longer considered best practise. At some stage in the future, this will -stop and you'll have to import them explicitly. - -Even then, you really should use the object oriented methods as they provide -a more consistent interface. For example: C<all_pm_files_ok()> calls the -C<plan()> function - so you can't call multiple test functions in the same test file. +stop and you'll have to import them explicitly to keep using them. -You should definitely use the object oriented interface described in the L</SYNOPSIS> -and in L<Test::Compile::Internal> instead of calling these functions. +The object oriented methods also provide a more consistent interface. +For example: C<all_pm_files_ok()> calls the C<plan()> function - so you can't call +multiple test functions in the same test file. =over 4 @@ -301,7 +301,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright 2007-2021 by the authors. +Copyright 2007-2023 by the authors. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -312,9 +312,9 @@ inner workings for) the Test::Compile functionality. L<Test::Strict> provides functions to ensure your perl files compile, with -added bonus that it will check you have used strict in all your files. +the added bonus that it will check you have used strict in all your files. + L<Test::LoadAllModules> just handles modules, not script files, but has more fine-grained control. - =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--find-files.t new/Test-Compile-v3.2.0/t/100-internal--find-files.t --- old/Test-Compile-v3.1.0/t/100-internal--find-files.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal--find-files.t 2023-04-02 22:14:39.000000000 +0200 @@ -10,19 +10,19 @@ my @files; -@files = sort $internal->_find_files(); +@files = $internal->_find_files(); is(scalar @files, 0, 'Found no files in the empty list'); -@files = sort $internal->_find_files('IDoNotExist/'); +@files = $internal->_find_files('IDoNotExist/'); is(scalar @files, 0 ,'Found no files in non existant directory'); -@files = sort $internal->_find_files('IDoNotExist.pm'); +@files = $internal->_find_files('IDoNotExist.pm'); is(scalar @files, 0 ,"Didn't find non existent file"); -@files = sort $internal->_find_files('t/scripts/'); +@files = $internal->_find_files('t/scripts/'); is(scalar @files, 12 ,'Found all the files in the scripts dir'); -@files = sort $internal->_find_files('t/scripts/datafile'); +@files = $internal->_find_files('t/scripts/datafile'); is(scalar @files, 1 ,'Found the file we specified'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--is-in-taint-mode.t new/Test-Compile-v3.2.0/t/100-internal--is-in-taint-mode.t --- old/Test-Compile-v3.1.0/t/100-internal--is-in-taint-mode.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal--is-in-taint-mode.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Test::More; -use Test::Compile::Internal; - -my $internal = Test::Compile::Internal->new(); - -my $TAINT = $internal->_is_in_taint_mode('t/scripts/taint.pl'); -is($TAINT,"T","Found taint flag in taint.pl"); - -my $taint = $internal->_is_in_taint_mode('t/scripts/CVS/taint2.pl'); -is($taint,"t","Found taint warning flag in taint2.pl"); - -my $not = $internal->_is_in_taint_mode('t/scripts/subdir/success.pl'); -is($not,"","No taint flags found in success.pl"); - -done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--perl-module.t new/Test-Compile-v3.2.0/t/100-internal--perl-module.t --- old/Test-Compile-v3.1.0/t/100-internal--perl-module.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Compile-v3.2.0/t/100-internal--perl-module.t 2023-04-02 22:14:39.000000000 +0200 @@ -0,0 +1,33 @@ +#!perl + +use strict; +use warnings; + +use Test::More; +use Test::Compile::Internal; + +my $internal = Test::Compile::Internal->new(); + +# given +# when +my $taint = $internal->_perl_module('t/scripts/taint.pl'); +# then +ok(!$taint, "taint.pl script is not a module"); + +# Given +# When +my $datafile = $internal->_perl_module('t/scripts/datafile'); +# Then +ok(!$datafile, "datafile isn't perl"); + +# Given +# When +my $perlscript = $internal->_perl_module('t/scripts/perlscript'); +ok(!$perlscript, "perlscript is not a module"); + +# Given +# When +my $module = $internal->_perl_module('t/scripts/Module.pm'); +ok($module, "Module.pm is a module"); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--perl-script.t new/Test-Compile-v3.2.0/t/100-internal--perl-script.t --- old/Test-Compile-v3.1.0/t/100-internal--perl-script.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Compile-v3.2.0/t/100-internal--perl-script.t 2023-04-02 22:14:39.000000000 +0200 @@ -0,0 +1,33 @@ +#!perl + +use strict; +use warnings; + +use Test::More; +use Test::Compile::Internal; + +my $internal = Test::Compile::Internal->new(); + +# given +# when +my $taint = $internal->_perl_script('t/scripts/taint.pl'); +# then +ok($taint, "taint.pl script is perll"); + +# Given +# When +my $datafile = $internal->_perl_script('t/scripts/datafile'); +# Then +ok(!$datafile, "datafile isn't perl"); + +# Given +# When +my $perlscript = $internal->_perl_script('t/scripts/perlscript'); +ok($perlscript, "perlscript is perl"); + +# Given +# When +my $module = $internal->_perl_script('t/scripts/Module.pm'); +ok(!$module, "Module is not a script"); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--skip.t new/Test-Compile-v3.2.0/t/100-internal--skip.t --- old/Test-Compile-v3.1.0/t/100-internal--skip.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal--skip.t 2023-04-02 22:14:39.000000000 +0200 @@ -9,7 +9,7 @@ my $internal = Test::Compile::Internal->new(); # Without this line, this test file would fail -$internal->skip_all('Skipping this test should test skip_all()'); +$internal->skip_all('testing skip_all()'); $internal->ok(0, "This is a failing test, but it shouldn't actually matter"); $internal->done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--taint-mode.t new/Test-Compile-v3.2.0/t/100-internal--taint-mode.t --- old/Test-Compile-v3.1.0/t/100-internal--taint-mode.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Compile-v3.2.0/t/100-internal--taint-mode.t 2023-04-02 22:14:39.000000000 +0200 @@ -0,0 +1,20 @@ +#!perl + +use strict; +use warnings; + +use Test::More; +use Test::Compile::Internal; + +my $internal = Test::Compile::Internal->new(); + +my $TAINT = $internal->_taint_mode('t/scripts/taint.pl'); +is($TAINT,"T","Found taint flag in taint.pl"); + +my $taint = $internal->_taint_mode('t/scripts/CVS/taint2.pl'); +is($taint,"t","Found taint warning flag in taint2.pl"); + +my $not = $internal->_taint_mode('t/scripts/subdir/success.pl'); +is($not,"","No taint flags found in success.pl"); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal--test-methods.t new/Test-Compile-v3.2.0/t/100-internal--test-methods.t --- old/Test-Compile-v3.1.0/t/100-internal--test-methods.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal--test-methods.t 2023-04-02 22:14:39.000000000 +0200 @@ -11,6 +11,6 @@ $internal->plan(tests => 2); $internal->ok(1, "ok method issues succesful TAP"); $internal->skip('Actually, skip this test'); -$internal->diag("The diag method should display this message"); +$internal->diag("Message displayed by the 'diag' method"); $internal->done_testing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal-all-pl-files.t new/Test-Compile-v3.2.0/t/100-internal-all-pl-files.t --- old/Test-Compile-v3.1.0/t/100-internal-all-pl-files.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal-all-pl-files.t 2023-04-02 22:14:39.000000000 +0200 @@ -3,7 +3,6 @@ use strict; use warnings; -use File::Spec; use Test::More; use Test::Compile::Internal; eval 'use Test::Warnings; 1;' @@ -13,13 +12,13 @@ my @files; -@files = sort $internal->all_pl_files(); +@files = $internal->all_pl_files(); is(scalar @files,0,'Found correct number of scripts in default location'); -@files = sort $internal->all_pl_files('t/scripts'); +@files = $internal->all_pl_files('t/scripts'); is(scalar @files,6,'Found correct number of scripts in t/scripts'); like($files[0],qr/t.scripts.failure.pl/,'Found script: failure.pl'); -like($files[1],qr/t.scripts.lib.pl/,'Found script: lib.pl'); +like($files[1],qr/t.scripts.messWithLib.pl/,'Found script: messWithLib.pl'); like($files[2],qr/t.scripts.perlscript$/,'Found script: perlscript'); like($files[3],qr/t.scripts.perlscript.psgi/i,'Found script: perlscript.pSgi'); like($files[4],qr/t.scripts.subdir.success.pl/,'Found script: success.pl'); @@ -28,13 +27,13 @@ # Try specifying som files rather than directories my @search = ('t/scripts/failure.pl', 't/scripts/Module.pm'); -@files = sort $internal->all_pl_files($search[0]); +@files = $internal->all_pl_files($search[0]); is(scalar @files,1,"found the specific pl file"); -@files = sort $internal->all_pl_files($search[1]); +@files = $internal->all_pl_files($search[1]); is(scalar @files,0,"didn't find the specific pm file"); -@files = sort $internal->all_pl_files(@search); +@files = $internal->all_pl_files(@search); is(scalar @files,1,"only found one specific file"); like($files[0],qr/t.scripts.failure.pl/,'Found specific file: failure.pl'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal-all-pm-files.t new/Test-Compile-v3.2.0/t/100-internal-all-pm-files.t --- old/Test-Compile-v3.1.0/t/100-internal-all-pm-files.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal-all-pm-files.t 2023-04-02 22:14:39.000000000 +0200 @@ -10,12 +10,12 @@ my @files; -@files = sort $internal->all_pm_files(); +@files = $internal->all_pm_files(); is(@files,2,'Found correct number of modules in default location'); like($files[0],qr/lib.Test.Compile.pm/,'Found module: Compile.pm'); like($files[1],qr/lib.Test.Compile.Internal.pm/,'Found module: Internal.pm'); -@files = sort $internal->all_pm_files('t/scripts'); +@files = $internal->all_pm_files('t/scripts'); is(@files,3,'Found correct number of modules in t/scripts'); like($files[0],qr/t.scripts.LethalImport.pm/,'Found module: Module2.pm'); like($files[1],qr/t.scripts.Module.pm/,'Found module: Module.pm'); @@ -24,13 +24,13 @@ # Try specifying some files rather than directories my @search = ('t/scripts/failure.pl', 't/scripts/Module.pm'); -@files = sort $internal->all_pm_files($search[0]); +@files = $internal->all_pm_files($search[0]); is(scalar @files,0,"didn't find the specific pl file"); -@files = sort $internal->all_pm_files($search[1]); +@files = $internal->all_pm_files($search[1]); is(scalar @files,1,"found the specific pm file"); -@files = sort $internal->all_pm_files(@search); +@files = $internal->all_pm_files(@search); is(scalar @files,1,"only found one specific file"); like($files[0],qr/t.scripts.Module.pm/,'Found specific file: failure.pl'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal-basic.t new/Test-Compile-v3.2.0/t/100-internal-basic.t --- old/Test-Compile-v3.1.0/t/100-internal-basic.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal-basic.t 2023-04-02 22:14:39.000000000 +0200 @@ -10,7 +10,10 @@ # Run some of the basic meithods, with basic test conditions # ..mostly just to ensure they get executed -my $result = $test->all_pl_files_ok('t/scripts/lib.pl'); + +my $result; + +$result = $test->all_pl_files_ok('t/scripts/messWithLib.pl'); $test->ok($result, "all_pl_files_ok returns true value"); $result = $test->all_pm_files_ok('lib/'); @@ -19,5 +22,12 @@ $result = $test->all_files_ok(); $test->ok($result, "all_files_ok returns true value"); +TODO: { + local $TODO = "testing scripts that don't compile, cause the test to fail"; + + $result = $test->all_files_ok('t/scripts/failure.pl'); + $test->ok($result, "failure.pl doesn't compile"); +} + # Fin... $test->done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal-mess-with-lib.t new/Test-Compile-v3.2.0/t/100-internal-mess-with-lib.t --- old/Test-Compile-v3.1.0/t/100-internal-mess-with-lib.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal-mess-with-lib.t 2023-04-02 22:14:39.000000000 +0200 @@ -10,11 +10,11 @@ my $test = Test::Compile::Internal->new(); -# lib.pl has a dodgy begin block which messes with @INC. +# messWithLib.pl has a dodgy begin block which messes with @INC. # - that should force it to *only* look in blib/lib for # modules.. but it should still compile. See rt72557 # for more details. -my $compiles = $test->pl_file_compiles('t/scripts/lib.pl'); -ok($compiles, "lib.pl compiles"); +my $compiles = $test->pl_file_compiles('t/scripts/messWithLib.pl'); +ok($compiles, "messWithLib.pl compiles"); done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/100-internal-pl-file-compiles.t new/Test-Compile-v3.2.0/t/100-internal-pl-file-compiles.t --- old/Test-Compile-v3.1.0/t/100-internal-pl-file-compiles.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/100-internal-pl-file-compiles.t 2023-04-02 22:14:39.000000000 +0200 @@ -9,23 +9,34 @@ my $internal = Test::Compile::Internal->new(); $internal->verbose(0); +# Given (success.pl) +# When my $yes = $internal->pl_file_compiles('t/scripts/subdir/success.pl'); +# Then is($yes,1,"success.pl should compile"); +# Given (taint.pl - script has -t in shebang) +# When my $taint = $internal->pl_file_compiles('t/scripts/taint.pl'); +# Then is($taint,1,"taint.pl should compile - with -T enabled"); -SKIP : { - skip("-t was introduced in perl 5.8.0 ($])", 1) unless $] gt '5.008'; - - my $taint2 = $internal->pl_file_compiles('t/scripts/CVS/taint2.pl'); - is($taint2,1,"taint2.pl should compile - with -t enabled"); -} - -my $no = $internal->pl_file_compiles('t/scripts/failure.pl'); -is($no,0,"failure.pl should not compile"); +# Given (taint2.pl - script has -T in shebang) +# When +my $taint2 = $internal->pl_file_compiles('t/scripts/CVS/taint2.pl'); +# Then +is($taint2,1,"taint2.pl should compile - with -t enabled"); + +# Given (failure.pl doesn't compile) +# When +my $failure = $internal->pl_file_compiles('t/scripts/failure.pl'); +# Then +is($failure,0,"failure.pl should not compile"); +# Given (no_file_here.pl doesn't exist) +# When my $not_found = $internal->pl_file_compiles('t/scripts/no_file_here.pl'); +# Then is($not_found,0,"no_file_here.pl should not compile"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/200-px-file-ok.t new/Test-Compile-v3.2.0/t/200-px-file-ok.t --- old/Test-Compile-v3.1.0/t/200-px-file-ok.t 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/200-px-file-ok.t 2023-04-02 22:14:39.000000000 +0200 @@ -5,7 +5,7 @@ use Test::Compile qw( pl_file_ok pm_file_ok ); # pl_file_ok() and pm_file_ok() both call 'ok()' as required -# so we can't that explicitly in this script... +# so we can't do that explicitly in this script... # this file is mostly just to increase the coverage. pl_file_ok('t/scripts/subdir/success.pl', 'success.pl compiles'); pm_file_ok('t/scripts/Module.pm', 'Module.pm compiles'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/perlcriticrc new/Test-Compile-v3.2.0/t/perlcriticrc --- old/Test-Compile-v3.1.0/t/perlcriticrc 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Compile-v3.2.0/t/perlcriticrc 2023-04-02 22:14:39.000000000 +0200 @@ -0,0 +1,12 @@ +# no strict 'refs' +[TestingAndDebugging::ProhibitNoStrict] +allow = refs + +[-BuiltinFunctions::ProhibitStringyEval] +[-ControlStructures::ProhibitMutatingListFunctions] +[-Subroutines::ProhibitExplicitReturnUndef] +[-Subroutines::ProhibitSubroutinePrototypes] +[-Variables::ProhibitConditionalDeclarations] + +# for mkdir $dir, 0777 +[-ValuesAndExpressions::ProhibitLeadingZeros] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/scripts/lib.pl new/Test-Compile-v3.2.0/t/scripts/lib.pl --- old/Test-Compile-v3.1.0/t/scripts/lib.pl 2022-06-02 07:31:28.000000000 +0200 +++ new/Test-Compile-v3.2.0/t/scripts/lib.pl 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -#!/usr/bin/perl - -BEGIN { - require strict; - require warnings; - require parent; - require Test::Builder; - require File::Spec; - require IPC::Open3; - require version; - @INC = grep { $_ eq 'blib/lib' } @INC; -} -use Test::Compile; - -sleep 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Compile-v3.1.0/t/scripts/messWithLib.pl new/Test-Compile-v3.2.0/t/scripts/messWithLib.pl --- old/Test-Compile-v3.1.0/t/scripts/messWithLib.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Compile-v3.2.0/t/scripts/messWithLib.pl 2023-04-02 22:14:39.000000000 +0200 @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +BEGIN { + require strict; + require warnings; + require parent; + require Test::Builder; + require File::Find; + require IPC::Open3; + require version; + @INC = grep { $_ eq 'blib/lib' } @INC; +} +use Test::Compile; + +sleep 1;