Hello community,

here is the log from the commit of package perl-Test-Compile for 
openSUSE:Factory checked in at 2019-07-17 14:27:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-Compile (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Test-Compile.new.1887 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Test-Compile"

Wed Jul 17 14:27:35 2019 rev:8 rq:715935 version:2.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Test-Compile/perl-Test-Compile.changes      
2019-07-02 10:39:35.706691312 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Test-Compile.new.1887/perl-Test-Compile.changes
    2019-07-17 14:27:36.447280203 +0200
@@ -1,0 +2,25 @@
+Tue Jul 16 10:10:09 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 2.2.2
+   see /usr/share/doc/packages/perl-Test-Compile/Changes
+
+  v2.2.2    2019-07-11
+      - Fix cpan-test failures on mswin32
+  
+  v2.2.1    2019-07-09
+      - Ooops, the module still depends on UNIVERSAL::require
+      - Oh, and the subprocess function now requires perl 5.10.0 
+  
+  v2.2.0    2019-07-08
+      - RT-118530: Capture (and optionally suppress) all output from 
subcommands
+      - RT-102817: Change the default value for 'verbose', from 1 to undef
+      - RT-118419: pm and pl files are now both checked using 'perl -c'
+      - Changes to POD: fixes to escaping, update for new functionality, 
simplify it
+      - The module no longer depends on UNIVERSAL::require
+  
+  v2.1.2    2019-07-03
+      - More corrections to the POD
+      - More tests, try specifying specific files to all_pX_files()
+      - Use the correct method in all_pl_files_ok() (Noel Maddy)
+
+-------------------------------------------------------------------

Old:
----
  Test-Compile-v2.1.1.tar.gz

New:
----
  Test-Compile-v2.2.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Test-Compile.spec ++++++
--- /var/tmp/diff_new_pack.gu6GMw/_old  2019-07-17 14:27:37.579276686 +0200
+++ /var/tmp/diff_new_pack.gu6GMw/_new  2019-07-17 14:27:37.579276686 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Test-Compile
-Version:        2.1.1
+Version:        2.2.2
 Release:        0
 %define cpan_name Test-Compile
 Summary:        Check whether Perl files compile correctly

++++++ Test-Compile-v2.1.1.tar.gz -> Test-Compile-v2.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/Build.PL 
new/Test-Compile-v2.2.2/Build.PL
--- old/Test-Compile-v2.1.1/Build.PL    2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/Build.PL    2019-07-11 11:37:59.000000000 +0200
@@ -12,7 +12,7 @@
     license  => 'perl',
     configure_requires => { 'Module::Build' => 0.38 },
     requires => {
-       'perl'               => '5.6.2',
+       'perl'               => '5.10.0',
        'UNIVERSAL::require' => 0,
        'version'            => 0,
        'parent'             => '0.225',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/Changes 
new/Test-Compile-v2.2.2/Changes
--- old/Test-Compile-v2.1.1/Changes     2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/Changes     2019-07-11 11:37:59.000000000 +0200
@@ -1,5 +1,24 @@
 Revision history for Perl extension Test-Compile
 
+v2.2.2    2019-07-11
+    - Fix cpan-test failures on mswin32
+
+v2.2.1    2019-07-09
+    - Ooops, the module still depends on UNIVERSAL::require
+    - Oh, and the subprocess function now requires perl 5.10.0 
+
+v2.2.0    2019-07-08
+    - RT-118530: Capture (and optionally suppress) all output from subcommands
+    - RT-102817: Change the default value for 'verbose', from 1 to undef
+    - RT-118419: pm and pl files are now both checked using 'perl -c'
+    - Changes to POD: fixes to escaping, update for new functionality, 
simplify it
+    - The module no longer depends on UNIVERSAL::require
+
+v2.1.2    2019-07-03
+    - More corrections to the POD
+    - More tests, try specifying specific files to all_pX_files()
+    - Use the correct method in all_pl_files_ok() (Noel Maddy)
+
 v2.1.1    2019-07-01              (Evan Giles <[email protected]>)
     - Correct the POD
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/META.json 
new/Test-Compile-v2.2.2/META.json
--- old/Test-Compile-v2.1.1/META.json   2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/META.json   2019-07-11 11:37:59.000000000 +0200
@@ -27,7 +27,7 @@
             "Exporter" : "5.68",
             "UNIVERSAL::require" : "0",
             "parent" : "0.225",
-            "perl" : "v5.6.2",
+            "perl" : "v5.10.0",
             "version" : "0"
          }
       }
@@ -35,11 +35,11 @@
    "provides" : {
       "Test::Compile" : {
          "file" : "lib/Test/Compile.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.2"
       },
       "Test::Compile::Internal" : {
          "file" : "lib/Test/Compile/Internal.pm",
-         "version" : "v2.1.1"
+         "version" : "v2.2.2"
       }
    },
    "release_status" : "stable",
@@ -51,6 +51,6 @@
          "url" : "http://github.com/egiles/test-compile";
       }
    },
-   "version" : "v2.1.1",
+   "version" : "v2.2.2",
    "x_serialization_backend" : "JSON::PP version 2.27400_02"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/META.yml 
new/Test-Compile-v2.2.2/META.yml
--- old/Test-Compile-v2.1.1/META.yml    2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/META.yml    2019-07-11 11:37:59.000000000 +0200
@@ -15,20 +15,20 @@
 provides:
   Test::Compile:
     file: lib/Test/Compile.pm
-    version: v2.1.1
+    version: v2.2.2
   Test::Compile::Internal:
     file: lib/Test/Compile/Internal.pm
-    version: v2.1.1
+    version: v2.2.2
 recommends:
   Devel::CheckOS: '0'
 requires:
   Exporter: '5.68'
   UNIVERSAL::require: '0'
   parent: '0.225'
-  perl: v5.6.2
+  perl: v5.10.0
   version: '0'
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/egiles/test-compile
-version: v2.1.1
+version: v2.2.2
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/Makefile.PL 
new/Test-Compile-v2.2.2/Makefile.PL
--- old/Test-Compile-v2.1.1/Makefile.PL 2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/Makefile.PL 2019-07-11 11:37:59.000000000 +0200
@@ -1,18 +1,18 @@
 # Note: this file was auto-generated by Module::Build::Compat version 0.4224
-require 5.006002;
+require 5.010000;
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
+  'EXE_FILES' => [],
+  'PL_FILES' => {},
   'PREREQ_PM' => {
                    'version' => 0,
                    'Exporter' => '5.68',
-                   'UNIVERSAL::require' => 0,
-                   'parent' => '0.225'
+                   'parent' => '0.225',
+                   'UNIVERSAL::require' => 0
                  },
-  'PL_FILES' => {},
-  'EXE_FILES' => [],
   'VERSION_FROM' => 'lib/Test/Compile.pm',
-  'INSTALLDIRS' => 'site',
-  'NAME' => 'Test::Compile'
+  'NAME' => 'Test::Compile',
+  'INSTALLDIRS' => 'site'
 )
 ;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/README 
new/Test-Compile-v2.2.2/README
--- old/Test-Compile-v2.1.1/README      2019-07-01 03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/README      2019-07-11 11:37:59.000000000 +0200
@@ -5,7 +5,7 @@
     individual files.
 
 DEPENDENCIES
-    Requires perl v5.6.2, plus
+    Requires perl v5.10.0, plus
     * UNIVERSAL::require
     * version
     * parent
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/lib/Test/Compile/Internal.pm 
new/Test-Compile-v2.2.2/lib/Test/Compile/Internal.pm
--- old/Test-Compile-v2.1.1/lib/Test/Compile/Internal.pm        2019-07-01 
03:20:51.000000000 +0200
+++ new/Test-Compile-v2.2.2/lib/Test/Compile/Internal.pm        2019-07-11 
11:37:59.000000000 +0200
@@ -3,10 +3,11 @@
 use warnings;
 use strict;
 
-use version; our $VERSION = qv("v2.1.1");
+use version; our $VERSION = qv("v2.2.2");
 use File::Spec;
 use UNIVERSAL::require;
 use Test::Builder;
+use IPC::Open3 ();
 
 =head1 NAME
 
@@ -99,7 +100,7 @@
     my $test = $self->{test};
 
     for my $file ( $self->all_pl_files(@dirs) ) {
-        my $ok = $self->pm_file_compiles($file);
+        my $ok = $self->pl_file_compiles($file);
         $test->ok($ok, "$file compiles");
     }
 }
@@ -107,20 +108,22 @@
 
 =item C<verbose($verbose)>
 
-An accessor to get/set the verbose flag.  If C<verbose> is set, you can get 
some
-extra diagnostics when compilation fails.
+An accessor to get/set the verbosity.  The default value (undef) will suppress 
output
+unless the compilation fails.  This is probably what you want.
+
+If C<verbose> is set to true, you'll get the output from 'perl -c'. If it's 
set to
+false, all diagnostic output is supressed.
 
-Verbose is set on by default.
 =cut
 
 sub verbose {
     my ($self, $verbose) = @_;
 
-    if ( defined($verbose) ) {
+    if ( @_ eq 2 ) {
         $self->{verbose} = $verbose;
     }
 
-    return defined($self->{verbose}) ? $self->{verbose} : 1;
+    return $self->{verbose};
 }
 
 =item C<all_pm_files(@dirs)>
@@ -196,20 +199,8 @@
 
 sub pl_file_compiles {
     my ($self, $file) = @_;
-    return $self->_run_subprocess(
-        sub{
-            if ( -f $file ) {
-                my @inc = ('blib/lib', @INC);
-                my $taint = $self->_is_in_taint_mode($file);
-                system($^X, (map { "-I$_" } @inc), "-c$taint", $file);
-                return ($? == 0);
-            }
-            else {
-                $self->{test}->diag("$file could not be found") if 
$self->verbose();
-                return 0;
-            }
-        }
-    );
+
+    return $self->_perl_file_compiles($file);
 }
 
 =item C<pm_file_compiles($file)>
@@ -221,28 +212,9 @@
 =cut
 
 sub pm_file_compiles {
-    my ($self, $file, %args) = @_;
+    my ($self, $file) = @_;
 
-    return $self->_run_subprocess(
-        sub{
-            if ( -f $file ) {
-                my $module = $file;
-                $module =~ s!^(blib[/\\])?lib[/\\]!!;
-                $module =~ s![/\\]!::!g;
-                $module =~ s/\.pm$//;
-
-                return 1 if $module->require;
-
-                $self->{test}->diag("Compilation of $module failed: $@")
-                  if $self->verbose();
-                return 0;
-            }
-            else {
-                $self->{test}->diag("$file could not be found") if 
$self->verbose();
-                return 0;
-            }
-        }
-    );
+    return $self->_perl_file_compiles($file);
 }
 
 =head1 TEST METHODS
@@ -273,7 +245,7 @@
     $self->{test}->ok(@args);
 }
 
-=item C<plan(tests => $count)>
+=item C<plan(tests =E<gt> $count)>
 
 Defines how many tests you plan to run.
 
@@ -323,24 +295,27 @@
     $self->{test}->skip_all(@args);
 }
 
-sub _run_subprocess {
-    my ($self, $closure) = @_;
-
-    my $pid = fork();
-    if ( ! defined($pid) ) {
-        return 0;
-    } elsif ( $pid ) {
-        wait();
-        return ($? ? 0 : 1);
-    }
-
-    if ( ! $self->verbose() ) {
-        open STDERR, '>', File::Spec->devnull;
+# Run a subcommand, catching STDOUT, STDERR and return code
+sub _run_command {
+    my ($self, $cmd) = @_;
+
+    my ($stdout, $stderr);
+    my $pid = IPC::Open3::open3(0, $stdout, $stderr, $cmd)
+        or die "open3() failed $!";
+
+    my $output;
+    for my $handle ( $stdout, $stderr ) {
+       if ( $handle ) {
+            while ( my $line = <$handle> ) {
+                push @$output, $line;
+            }
+        }
     }
 
-    my $rv = $closure->();
+    waitpid($pid, 0);
+    my $success = ($? == 0 ? 1 : 0);
 
-    exit ($rv ? 0 : 1);
+    return ($success, $output);
 }
 
 # Works it's way through the input array (files and/or directories), 
recursively
@@ -372,16 +347,43 @@
     return @output;
 }
 
+# Check the syntax of a perl file
+sub _perl_file_compiles {
+    my ($self, $file) = @_;
+
+    if ( ! -f $file ) {
+        $self->{test}->diag("$file could not be found") if $self->verbose();
+        return 0;
+    }
+
+    my @inc = ('blib/lib', @INC);
+    my $taint = $self->_is_in_taint_mode($file);
+    my $command = join(" ", ($^X, (map { "-I$_" } @inc), "-c$taint", $file));
+    my ($compiles, $output) = $self->_run_command($command);
+    if ( $output && (!defined($self->verbose()) || $self->verbose() != 0) ) {
+        if ( !$compiles || $self->verbose() ) {
+            for my $line ( @$output ) {
+                $self->{test}->diag($line);
+            }
+        }
+    }
+
+    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 programs?
 sub _pl_starting_points {
     return 'script' if -e 'script';
     return 'bin'    if -e 'bin';
 }
 
+# Extract the shebang line from a perl program
 sub _read_shebang {
     my ($self, $file) = @_;
 
@@ -392,6 +394,7 @@
     }
 }
 
+# Should the given file be checked with taint mode on?
 sub _is_in_taint_mode {
     my ($self, $file) = @_;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/lib/Test/Compile.pm 
new/Test-Compile-v2.2.2/lib/Test/Compile.pm
--- old/Test-Compile-v2.1.1/lib/Test/Compile.pm 2019-07-01 03:20:51.000000000 
+0200
+++ new/Test-Compile-v2.2.2/lib/Test/Compile.pm 2019-07-11 11:37:59.000000000 
+0200
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use version; our $VERSION = qv("v2.1.1");
+use version; our $VERSION = qv("v2.2.2");
 use parent 'Exporter';
 use UNIVERSAL::require;
 use Test::Compile::Internal;
@@ -120,21 +120,6 @@
 The order of the files returned is machine-dependent. If you want them
 sorted, you'll have to sort them yourself.
 
-=item C<pl_file_compiles($file)>
-
-Returns true if C<$file> compiles as a perl script.
-
-=item C<pm_file_compiles($file)>
-
-Returns true if C<$file> compiles as a perl module.
-
-=item C<verbose($verbose)>
-
-An accessor to get/set the verbose flag.  If C<verbose> is set, you can get 
some
-extra diagnostics when compilation fails.
-
-Verbose is set on by default.
-
 =back
 
 =head2 Test Methods
@@ -148,15 +133,6 @@
 
 Declares that you are done testing, no more tests will be run after this point.
 
-=item C<ok($test, $name)>
-
-Your basic test. Pass if C<$test> is true, fail if C<$test> is false. Just
-like C<Test::Simple>'s C<ok()>.
-
-=item C<plan($count)>
-
-Defines how many tests you plan to run.
-
 =item C<diag(@msgs)>
 
 Prints out the given C<@msgs>. Like print, arguments are simply appended
@@ -171,10 +147,6 @@
 
 Skips the current test, reporting the C<$reason>.
 
-=item C<skip_all($reason)>
-
-Skips all the tests, using the given C<$reason>. Exits immediately with 0.
-
 =back
 
 =head1 FUNCTIONS
@@ -207,21 +179,6 @@
 
 Returns true if all Perl module files are ok, or false if any fail.
 
-Module authors can include the following in a F<t/00_compile.t> file
-and have C<Test::Compile> automatically find and check all Perl module files
-in a module distribution:
-
-    #!perl -w
-    use strict;
-    use warnings;
-    use Test::More;
-    eval "use Test::Compile";
-    Test::More->builder->BAIL_OUT(
-        "Test::Compile required for testing compilation") if $@;
-    my $test = Test::Compile->new();
-    $test->all_pm_files_ok();
-    $test->done_testing();
-
 =cut
 
 sub all_pm_files_ok {
@@ -339,7 +296,7 @@
 Returns a list of all the perl module files - that is, files ending in F<.pm>
 - in I<@dirs> and in directories below. If no directories are passed, it
 defaults to F<blib> if F<blib> exists, or else F<lib> if not. Skips any files
-in C<CVS> or C<.svn> directories.
+in C<CVS>, C<.svn>, or C<.git> directories.
 
 The order of the files returned is machine-dependent. If you want them
 sorted, you'll have to sort them yourself.
@@ -383,10 +340,6 @@
     return $Test->all_files_ok(@_);
 }
 
-sub _verbose {
-    return $Test->verbose(@_);
-}
-
 1;
 
 =head1 AUTHORS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/100-internal-all-pl-files.t 
new/Test-Compile-v2.2.2/t/100-internal-all-pl-files.t
--- old/Test-Compile-v2.1.1/t/100-internal-all-pl-files.t       2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/100-internal-all-pl-files.t       2019-07-11 
11:37:59.000000000 +0200
@@ -24,4 +24,17 @@
 like($files[3],qr/t.scripts.subdir.success.pl/,'Found script: success.pl');
 like($files[4],qr/t.scripts.taint.pl/,'Found script: taint.pl');
 
+# 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]);
+is(scalar @files,1,"found the specific pl file");
+
+@files = sort $internal->all_pl_files($search[1]);
+is(scalar @files,0,"didn't find the specific pm file");
+
+@files = sort $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');
+
 $internal->done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/100-internal-all-pm-files.t 
new/Test-Compile-v2.2.2/t/100-internal-all-pm-files.t
--- old/Test-Compile-v2.1.1/t/100-internal-all-pm-files.t       2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/100-internal-all-pm-files.t       2019-07-11 
11:37:59.000000000 +0200
@@ -21,4 +21,17 @@
 like($files[1],qr/t.scripts.Module.pm/,'Found module: Module.pm');
 like($files[2],qr/t.scripts.Module2.pm/,'Found module: Module2.pm');
 
+# Try specifying som files rather than directories
+my @search = ('t/scripts/failure.pl', 't/scripts/Module.pm');
+
+@files = sort $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]);
+is(scalar @files,1,"found the specific pm file");
+
+@files = sort $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');
+
 $internal->done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/100-internal-basic.t 
new/Test-Compile-v2.2.2/t/100-internal-basic.t
--- old/Test-Compile-v2.1.1/t/100-internal-basic.t      2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/100-internal-basic.t      2019-07-11 
11:37:59.000000000 +0200
@@ -6,7 +6,12 @@
 use Test::More;
 
 require_ok('Test::Compile::Internal');
+my $test = new_ok('Test::Compile::Internal');
 
-my $internal = new_ok('Test::Compile::Internal');
+# Run some of the basic meithods, with basic test conditions
+# ..mostly just to ensure they get executed
+$test->all_pl_files_ok('t/scripts/lib.pl');
+$test->all_pm_files_ok('lib/');
 
-$internal->done_testing();
+# Fin...
+$test->done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/100-internal-mess-with-lib.t 
new/Test-Compile-v2.2.2/t/100-internal-mess-with-lib.t
--- old/Test-Compile-v2.1.1/t/100-internal-mess-with-lib.t      2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/100-internal-mess-with-lib.t      2019-07-11 
11:37:59.000000000 +0200
@@ -9,7 +9,6 @@
 plan skip_all => "Distribution hasn't been built yet" unless -d "blib/lib";
 
 my $test = Test::Compile::Internal->new();
-$test->verbose(0);
 
 # lib.pl has a dodgy begin block which messes with @INC.
 # - that should force it to *only* look in blib/lib for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/100-internal-verbose.t 
new/Test-Compile-v2.2.2/t/100-internal-verbose.t
--- old/Test-Compile-v2.1.1/t/100-internal-verbose.t    2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/100-internal-verbose.t    2019-07-11 
11:37:59.000000000 +0200
@@ -12,35 +12,68 @@
 
 
 sub makeAnError {
-    my ($verbose) = @_;
+    my ($verbose, $file) = @_;
 
     my $internal = Test::Compile::Internal->new();
     $internal->verbose($verbose);
 
     # Might output "$0 syntax OK" to STDERR
-    $internal->pl_file_compiles($0);
+    $internal->pl_file_compiles($file);
 }
 
 sub main {
     my (@args) = @_;
 
-    if ( @args && $args[0] =~ m/silent/ ) {
-        makeAnError(0);
+    if ( @args ) {
+        my $verbose;
+        my $file = $0;
+        if ( $args[0] =~ m/silent/ ) {
+            $verbose = 0;
+        }
+        if ( $args[0] =~ m/verbose/ ) {
+            $verbose = 1;
+        }
+        if ( $args[1] =~ m/failure/ ) {
+            $file = 't/scripts/failure.pl';
+        }
+        makeAnError($verbose, $file);
         return;
     }
-    if ( @args && $args[0] =~ m/verbose/ ) {
-        makeAnError(1);
-        return;
-    }
-
-    local $ENV{PERL5LIB} = join(":",@INC);
-    my $cmd = "$^X $0";
 
-    my $silent = `$cmd silent 2>&1`;
-    is($silent,"","no output when in silent mode");
+    # Test that the accessor functionality works
+    my $test_object = Test::Compile::Internal->new();
+    is($test_object->verbose(), undef, "verbosity defaults to undef");
+
+    $test_object->verbose(1);
+    is($test_object->verbose(), 1, "setting verbosity to 1 is stored in the 
object");
+
+    $test_object->verbose(0);
+    is($test_object->verbose(), 0, "setting verbosity to 0 is stored in the 
object");
+
+    $test_object->verbose(undef);
+    is($test_object->verbose(), undef, "setting verbosity to undef is stored 
in the object");
+
+    # Test that the verbosity setting is honoured
+    my $tests = [
+        ['default', 'success', 'no output'],
+        ['default', 'failure', 'output'],
+        ['silent',  'success', 'no output'],
+        ['silent',  'failure', 'no output'],
+        ['verbose', 'success', 'output'],
+        ['verbose', 'failure', 'output'],
+    ];
 
-    my $verbose = `$cmd verbose 2>&1`;
-    isnt($verbose,"","got some output when in verbose mode");
+    local $ENV{PERL5LIB} = join(":",@INC);
+    for my $test ( @$tests ) {
+        my $cmd = "$^X $0 $test->[0] $test->[1]";
+        my $output = `$cmd 2>&1`;
+        my $name = "verbose: $test->[0], script: $test->[1], should produce: 
$test->[2]";
+        if ( $test->[2] eq "output" ) {
+            isnt($output, "", $name);
+        } else {
+            is($output, "", $name);
+        }
+    }
 
     done_testing();
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/200-import-check.t 
new/Test-Compile-v2.2.2/t/200-import-check.t
--- old/Test-Compile-v2.1.1/t/200-import-check.t        2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/200-import-check.t        2019-07-11 
11:37:59.000000000 +0200
@@ -3,7 +3,6 @@
 use warnings;
 use Test::More;
 use Test::Compile;
-Test::Compile::_verbose(0);
 
 plan skip_all => "Test::Exception required for checking exceptions"
     unless eval "use Test::Exception; 1";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/200-pl-file-ok-vms.t 
new/Test-Compile-v2.2.2/t/200-pl-file-ok-vms.t
--- old/Test-Compile-v2.1.1/t/200-pl-file-ok-vms.t      2019-07-01 
03:20:52.000000000 +0200
+++ new/Test-Compile-v2.2.2/t/200-pl-file-ok-vms.t      2019-07-11 
11:37:59.000000000 +0200
@@ -6,5 +6,5 @@
 
 # cheap emulation
 $^O = 'VMS';
-Test::Compile::_verbose(0);
+
 pl_file_ok('t/scripts/subdir/success.pl', 'success.pl compiles');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/200-pl-file-ok.t 
new/Test-Compile-v2.2.2/t/200-pl-file-ok.t
--- old/Test-Compile-v2.1.1/t/200-pl-file-ok.t  2019-07-01 03:20:52.000000000 
+0200
+++ new/Test-Compile-v2.2.2/t/200-pl-file-ok.t  2019-07-11 11:37:59.000000000 
+0200
@@ -4,5 +4,4 @@
 use Test::More tests => 1;
 use Test::Compile qw( pl_file_ok );
 
-Test::Compile::_verbose(0);
 pl_file_ok('t/scripts/subdir/success.pl', 'success.pl compiles');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/200-taint.t 
new/Test-Compile-v2.2.2/t/200-taint.t
--- old/Test-Compile-v2.1.1/t/200-taint.t       2019-07-01 03:20:52.000000000 
+0200
+++ new/Test-Compile-v2.2.2/t/200-taint.t       2019-07-11 11:37:59.000000000 
+0200
@@ -4,6 +4,5 @@
 use Test::More tests => 1;
 use Test::Compile qw( pl_file_ok );
 
-Test::Compile::_verbose(0);
 pl_file_ok('t/scripts/taint.pl', 'taint.pl compiles');
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Compile-v2.1.1/t/scripts/lib.pl 
new/Test-Compile-v2.2.2/t/scripts/lib.pl
--- old/Test-Compile-v2.1.1/t/scripts/lib.pl    2019-07-01 03:20:52.000000000 
+0200
+++ new/Test-Compile-v2.2.2/t/scripts/lib.pl    2019-07-11 11:37:59.000000000 
+0200
@@ -6,6 +6,7 @@
     require parent;
     require Test::Builder;
     require File::Spec;
+    require IPC::Open3;
     require UNIVERSAL::require;
     require version;
     @INC = grep { $_ eq 'blib/lib' } @INC;


Reply via email to