In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/14ff76602d3e7226409b169cf8072cf37c7c2d47?hp=c39276c156ff67dad494311eae94bd52e7d9570d>

- Log -----------------------------------------------------------------
commit 14ff76602d3e7226409b169cf8072cf37c7c2d47
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Wed Nov 22 18:41:52 2017 -0800

    bisect-runner: Add --test-module option
    
    See the POD documentation in the diff for details.

-----------------------------------------------------------------------

Summary of changes:
 Porting/bisect-runner.pl | 47 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl
index b127540b2b..6f9fd9d653 100755
--- a/Porting/bisect-runner.pl
+++ b/Porting/bisect-runner.pl
@@ -67,7 +67,7 @@ unless(GetOptions(\%options,
                   'all-fixups', 'early-fixup=s@', 'late-fixup=s@', 'valgrind',
                   'check-args', 'check-shebang!', 'usage|help|?', 'gold=s',
                   'module=s', 'with-module=s', 'cpan-config-dir=s',
-                  'no-module-tests',
+                  'test-module=s', 'no-module-tests',
                   'A=s@',
                   'D=s@' => sub {
                       my (undef, $val) = @_;
@@ -128,13 +128,23 @@ if (defined $target && $target =~ /\.t\z/) {
 }
 
 pod2usage(exitval => 255, verbose => 1)
-    unless @ARGV || $match || $options{'test-build'} || defined 
$options{'one-liner'} || defined $options{module};
+    unless @ARGV || $match || $options{'test-build'}
+        || defined $options{'one-liner'} || defined $options{module}
+        || defined $options{'test-module'};
 pod2usage(exitval => 255, verbose => 1)
     if !$options{'one-liner'} && ($options{l} || $options{w});
 if ($options{'no-module-tests'} && $options{module}) {
     print STDERR "--module and --no-module-tests are exclusive.\n\n";
     pod2usage(exitval => 255, verbose => 1)
 }
+if ($options{'no-module-tests'} && $options{'test-module'}) {
+    print STDERR "--test-module and --no-module-tests are exclusive.\n\n";
+    pod2usage(exitval => 255, verbose => 1)
+}
+if ($options{module} && $options{'test-module'}) {
+    print STDERR "--module and --test-module are exclusive.\n\n";
+    pod2usage(exitval => 255, verbose => 1)
+}
 
 check_shebang($ARGV[0])
     if $options{'check-shebang'} && @ARGV && !$options{match};
@@ -615,6 +625,21 @@ For example:
 
 =item *
 
+--test-module
+
+This is like I<--module>, but just runs the module's tests, instead of
+installing it.
+
+WARNING: This is a somewhat experimental option, known to work on recent
+CPAN shell versions.  If you use this option and strange things happen,
+please report them.
+
+Usually, you can just use I<--module>, but if you are getting inconsistent
+installation failures and you just want to see when the tests started
+failing, you might find this option useful.
+
+=item *
+
 --cpan-config-dir /home/blah/custom
 
 If defined, this will cause L<CPAN> to look for F<CPAN/MyConfig.pm> inside of
@@ -1398,7 +1423,8 @@ push @ARGS, map {"-A$_"} @{$options{A}};
 my $prefix;
 
 # Testing a module? We need to install perl/cpan modules to a temp dir
-if ($options{module} || $options{'with-module'}) {
+if ($options{module} || $options{'with-module'} || $options{'test-module'})
+{
   $prefix = tempdir(CLEANUP => 1);
 
   push @ARGS, "-Dprefix=$prefix";
@@ -1489,11 +1515,13 @@ if ($target ne 'miniperl') {
 }
 
 # Testing a cpan module? See if it will install
-if ($options{module} || $options{'with-module'}) {
+my $just_testing;
+if (my $mod_opt = $options{module} || $options{'with-module'}
+               || ($just_testing++, $options{'test-module'})) {
   # First we need to install this perl somewhere
   system_or_die('./installperl');
 
-  my @m = split(',', $options{module} || $options{'with-module'});
+  my @m = split(',', $mod_opt);
 
   my $bdir = File::Temp::tempdir(
     CLEANUP => 1,
@@ -1526,15 +1554,18 @@ if ($options{module} || $options{'with-module'}) {
     s/-/::/g if /-/ and !m|/|;
   }
   my $install = join ",", map { "'$_'" } @m;
-  if ($options{'no-module-tests'}) {
+  if ($just_testing) {
+    $install = "test($install)";
+  } elsif ($options{'no-module-tests'}) {
     $install = "notest('install',$install)";
   } else {
     $install = "install($install)";
   }
   my $last = $m[-1];
-  my $shellcmd = "$install; die unless CPAN::Shell->expand(Module => 
'$last')->uptodate;";
+  my $status_method = $just_testing ? 'test' : 'uptodate';
+  my $shellcmd = "$install; die unless CPAN::Shell->expand(Module => 
'$last')->$status_method;";
 
-  if ($options{module}) {
+  if ($options{module} || $options{'test-module'}) {
     run_report_and_exit(@cpanshell, $shellcmd);
   } else {
     my $ret = run_with_options({setprgp => $options{setpgrp},

-- 
Perl5 Master Repository

Reply via email to