Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Test-Needs for openSUSE:Factory 
checked in at 2023-02-01 16:38:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-Needs (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Test-Needs.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Test-Needs"

Wed Feb  1 16:38:33 2023 rev:6 rq:1062198 version:0.002010

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Test-Needs/perl-Test-Needs.changes  
2021-06-05 23:31:31.072436482 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Test-Needs.new.32243/perl-Test-Needs.changes   
    2023-02-01 16:50:29.617528183 +0100
@@ -1,0 +2,10 @@
+Mon Jan 23 03:12:23 UTC 2023 - Tina Müller <[email protected]>
+
+- updated to 0.002010
+   see /usr/share/doc/packages/perl-Test-Needs/Changes
+
+  0.002010 - 2023-01-22
+    - split main test into three separate scripts
+    - avoid outputting multiple plans if used with no_plan
+
+-------------------------------------------------------------------

Old:
----
  Test-Needs-0.002009.tar.gz

New:
----
  Test-Needs-0.002010.tar.gz

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

Other differences:
------------------
++++++ perl-Test-Needs.spec ++++++
--- /var/tmp/diff_new_pack.HKpeen/_old  2023-02-01 16:50:29.973530292 +0100
+++ /var/tmp/diff_new_pack.HKpeen/_new  2023-02-01 16:50:29.977530316 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Test-Needs
 #
-# Copyright (c) 2021 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,10 +18,10 @@
 
 %define cpan_name Test-Needs
 Name:           perl-Test-Needs
-Version:        0.002009
+Version:        0.002010
 Release:        0
-Summary:        Skip tests when modules not available
 License:        Artistic-1.0 OR GPL-1.0-or-later
+Summary:        Skip tests when modules not available
 URL:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/H/HA/HAARG/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml

++++++ Test-Needs-0.002009.tar.gz -> Test-Needs-0.002010.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/Changes 
new/Test-Needs-0.002010/Changes
--- old/Test-Needs-0.002009/Changes     2021-05-25 08:27:57.000000000 +0200
+++ new/Test-Needs-0.002010/Changes     2023-01-22 11:02:30.000000000 +0100
@@ -1,5 +1,9 @@
 Revision history for Test::Needs
 
+0.002010 - 2023-01-22
+  - split main test into three separate scripts
+  - avoid outputting multiple plans if used with no_plan
+
 0.002009 - 2021-05-25
   - fix warnings from Test::Builder if Test::Needs is loaded first, and is
     used to check for a Test module.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/LICENSE 
new/Test-Needs-0.002010/LICENSE
--- old/Test-Needs-0.002009/LICENSE     2021-05-25 08:28:24.000000000 +0200
+++ new/Test-Needs-0.002010/LICENSE     2023-01-22 11:02:47.000000000 +0100
@@ -7,7 +7,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2021 by haarg - Graham Knop (cpan:HAARG) 
<[email protected]>.
+This software is Copyright (c) 2023 by haarg - Graham Knop (cpan:HAARG) 
<[email protected]>.
 
 This is free software, licensed under:
 
@@ -267,7 +267,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2021 by haarg - Graham Knop (cpan:HAARG) 
<[email protected]>.
+This software is Copyright (c) 2023 by haarg - Graham Knop (cpan:HAARG) 
<[email protected]>.
 
 This is free software, licensed under:
 
@@ -287,21 +287,21 @@
 
   - "Package" refers to the collection of files distributed by the Copyright
     Holder, and derivatives of that collection of files created through
-    textual modification. 
+    textual modification.
   - "Standard Version" refers to such a Package if it has not been modified,
     or has been modified in accordance with the wishes of the Copyright
-    Holder. 
+    Holder.
   - "Copyright Holder" is whoever is named in the copyright or copyrights for
-    the package. 
+    the package.
   - "You" is you, if you're thinking about copying or distributing this 
Package.
   - "Reasonable copying fee" is whatever you can justify on the basis of media
     cost, duplication charges, time of people involved, and so on. (You will
     not be required to justify it to the Copyright Holder, but only to the
-    computing community at large as a market that must bear the fee.) 
+    computing community at large as a market that must bear the fee.)
   - "Freely Available" means that no fee is charged for the item itself, though
     there may be fees involved in handling the item. It also means that
     recipients of the item may redistribute it under the same conditions they
-    received it. 
+    received it.
 
 1. You may make and give away verbatim copies of the source form of the
 Standard Version of this Package without restriction, provided that you
@@ -368,7 +368,7 @@
 
 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 The End
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/MANIFEST 
new/Test-Needs-0.002010/MANIFEST
--- old/Test-Needs-0.002009/MANIFEST    2021-05-25 08:28:24.000000000 +0200
+++ new/Test-Needs-0.002010/MANIFEST    2023-01-22 11:02:47.000000000 +0100
@@ -3,12 +3,15 @@
 maint/Makefile.PL.include
 Makefile.PL
 MANIFEST                       This list of files
-t/basic.t
 t/find_missing.t
 t/lib/BrokenModule.pm
 t/lib/ModuleWithVersion.pm
+t/lib/TestAPI.pm
 t/lib/TestScript.pm
 t/numify_version.t
+t/standalone.t
+t/test-builder.t
+t/test2.t
 META.yml                                 Module YAML meta-data (added by 
MakeMaker)
 META.json                                Module JSON meta-data (added by 
MakeMaker)
 README                                   README file (added by Distar)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/META.json 
new/Test-Needs-0.002010/META.json
--- old/Test-Needs-0.002009/META.json   2021-05-25 08:28:23.000000000 +0200
+++ new/Test-Needs-0.002010/META.json   2023-01-22 11:02:47.000000000 +0100
@@ -4,7 +4,7 @@
       "haarg - Graham Knop (cpan:HAARG) <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "perl_5"
    ],
@@ -56,11 +56,11 @@
       },
       "x_IRC" : "irc://irc.perl.org/#perl-qa"
    },
-   "version" : "0.002009",
+   "version" : "0.002010",
    "x_cpants" : {
       "ignore" : {
          "prereq_matches_use" : "required modules detected incorrectly"
       }
    },
-   "x_serialization_backend" : "JSON::PP version 4.06"
+   "x_serialization_backend" : "JSON::PP version 4.16"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/META.yml 
new/Test-Needs-0.002010/META.yml
--- old/Test-Needs-0.002009/META.yml    2021-05-25 08:28:22.000000000 +0200
+++ new/Test-Needs-0.002010/META.yml    2023-01-22 11:02:46.000000000 +0100
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,7 +24,7 @@
   bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Needs
   license: http://dev.perl.org/licenses/
   repository: https://github.com/haarg/Test-Needs.git
-version: '0.002009'
+version: '0.002010'
 x_cpants:
   ignore:
     prereq_matches_use: 'required modules detected incorrectly'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/Makefile.PL 
new/Test-Needs-0.002010/Makefile.PL
--- old/Test-Needs-0.002009/Makefile.PL 2018-04-25 15:59:33.000000000 +0200
+++ new/Test-Needs-0.002010/Makefile.PL 2023-01-22 10:17:47.000000000 +0100
@@ -67,6 +67,9 @@
   if $mymeta_broken;
 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
   unless -f 'META.yml';
+$MM_ARGS{PL_FILES} ||= {};
+$MM_ARGS{NORECURS} = 1
+  if not exists $MM_ARGS{NORECURS};
 
 for (qw(configure build test runtime)) {
   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/lib/Test/Needs.pm 
new/Test-Needs-0.002010/lib/Test/Needs.pm
--- old/Test-Needs-0.002009/lib/Test/Needs.pm   2021-05-25 08:27:29.000000000 
+0200
+++ new/Test-Needs-0.002010/lib/Test/Needs.pm   2023-01-22 11:02:27.000000000 
+0100
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 no warnings 'once';
-our $VERSION = '0.002009';
+our $VERSION = '0.002010';
 $VERSION =~ tr/_//d;
 
 BEGIN {
@@ -175,27 +175,29 @@
     my $tb = Test::Builder->new;
     my $has_plan = Test::Builder->can('has_plan') ? 'has_plan'
       : sub { $_[0]->expected_tests || eval { 
$_[0]->current_test($_[0]->current_test); 'no_plan' } };
+    my $tests = $tb->current_test;
     if ($fail) {
       $tb->plan(tests => 1)
         unless $tb->$has_plan;
+      $tests++;
       $tb->ok(0, "Test::Needs modules available");
       $tb->diag($message);
     }
     else {
       my $plan = $tb->$has_plan;
-      my $tests = $tb->current_test;
       if ($plan || $tests) {
         my $skips
           = $plan && $plan ne 'no_plan' ? $plan - $tests : 1;
         $tb->skip("Test::Needs modules not available")
           for 1 .. $skips;
+        $tests += $skips;
         Test::Builder->can('note') ? $tb->note($message) : print "# 
$message\n";
       }
       else {
         $tb->skip_all($message);
       }
     }
-    $tb->done_testing
+    $tb->done_testing($tests)
       if Test::Builder->can('done_testing');
     die bless {} => 'Test::Builder::Exception'
       if Test::Builder->can('parent') && $tb->parent;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/t/basic.t 
new/Test-Needs-0.002010/t/basic.t
--- old/Test-Needs-0.002009/t/basic.t   2019-07-12 12:08:40.000000000 +0200
+++ new/Test-Needs-0.002010/t/basic.t   1970-01-01 01:00:00.000000000 +0100
@@ -1,248 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 17*3 + 31*2;
-use IPC::Open3;
-use Config ();
-
-delete $ENV{RELEASE_TESTING};
-
-my @perl = $^X =~ /(.*)/s;
-
-{
-  my $taint;
-  local $^W = 0;
-  local $@;
-  local $SIG{__DIE__};
-  local $SIG{__WARN__} = sub {
-    $taint = 1;
-    push @perl, '-t';
-  };
-  if (!eval { eval substr($ENV{PATH}, 0, 0); 1 }) {
-    $taint = 1;
-    push @perl, '-T';
-  }
-  if ($taint) {
-    $ENV{PATH} = '/';
-    delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
-  }
-}
-
-my %inc;
-{
-  my $cmd = join ' ', map qq{"$_"}, @perl, '-le', 'print for @INC';
-  my @inc = `$cmd`;
-  chomp @inc;
-  @inc{@inc} = ();
-}
-my @need_inc;
-my $i = -1;
-push @need_inc, $INC[$i]
-  while ++$i < @INC && !exists $inc{$INC[$i]};
-
-my $inc_extension = 
qr/[\\\/]\Q$Config::Config{archname}\E|[\\\/]\Q$Config::Config{version}\E(?:[\\\/]\Q$Config::Config{archname}\E)?/;
-
-my $bare;
-for my $path (@need_inc) {
-  unless (defined $bare and $path =~ /\A\Q$bare\E$inc_extension\z/) {
-    $bare = $path;
-    push @perl, "-I$path";
-  }
-}
-
-push @perl, "-It/lib";
-
-my $missing = "Module::Does::Not::Exist::".time;
-
-sub capture {
-  my $pid = open3 my $stdin, my $stdout, undef, @_
-    or die "can't run @_: $!";
-  my $out = do { local $/; <$stdout> };
-  close $stdout;
-  waitpid $pid, 0;
-  my $exit = $?;
-  return wantarray ? ($exit, $out) : $exit;
-}
-
-for my $api (
-  ['standalone'],
-  ['Test2' => 'Test2::API'],
-  ['Test::Builder' => 'Test::Builder']
-) {
-  SKIP: {
-    my ($label, @load) = @$api;
-    my @using = map {
-      my ($e, $o) = capture @perl, "-m$_", "-eprint+$_->VERSION";
-      skip "$label not available", 17+31
-        if $e;
-      "$_ $o";
-    } @load;
-    print "# Checking against ".join(', ', @using)."\n"
-      if @using;
-    my $check = sub {
-      my ($args, $match, $name) = @_;
-      my @args = ((map "--load=$_", @load), @$args);
-      my ($exit, $out)
-        = capture @perl, '-MTestScript' . (@args ? '='.join(',', @args) : '');
-      $name = "$label: $name";
-      my $want_exit;
-      my $unmatch;
-      if (ref $match eq 'HASH') {
-        $want_exit = $match->{exit};
-        $unmatch = $match->{unmatch};
-        $match = $match->{match};
-      }
-      $match = !defined $match ? [] : ref $match eq 'ARRAY' ? $match : 
[$match];
-      $unmatch = !defined $unmatch ? [] : ref $unmatch eq 'ARRAY' ? $unmatch : 
[$unmatch];
-      if (!is $exit == 0, !$want_exit, "$name - exit status") {
-        ok 0, $name
-          for 0 .. $#$match, 0 .. $#$unmatch;
-        diag "Exit status $exit\nOutput:\n$out";
-      }
-      else {
-        for my $m (@$match) {
-          like $out, $m, $name;
-        }
-        for my $um (@$unmatch) {
-          unlike $out, $um, $name;
-        }
-      }
-    };
-
-    $check->(
-      [$missing],
-      qr/^1\.\.0 # SKIP/i,
-      'Missing module SKIPs',
-    );
-    $check->(
-      ['BrokenModule'],
-      { match => qr/syntax error/, exit => 1 },
-      'Broken module dies',
-    );
-    $check->(
-      ['ModuleWithVersion'],
-      qr/^(?!1\.\.0 # SKIP)/i,
-      'Working module runs',
-    );
-    $check->(
-      ['ModuleWithVersion', 2],
-      qr/^1\.\.0 # SKIP/i,
-      'Outdated module SKIPs',
-    );
-
-    {
-      local $ENV{RELEASE_TESTING} = 1;
-      $check->(
-        [$missing],
-        { match => qr/^not ok/m, exit => 1 },
-        'Missing module fails with RELEASE_TESTING',
-      );
-      $check->(
-        ['BrokenModule'],
-        { match => qr/syntax error/, exit => 1 },
-        'Broken module dies with RELEASE_TESTING',
-      );
-      $check->(
-        ['ModuleWithVersion'],
-        qr/^(?!1\.\.0 # SKIP)/i,
-        'Working module runs with RELEASE_TESTING',
-      );
-      $check->(
-        ['ModuleWithVersion', 2],
-        { match => qr/^not ok/m, unmatch => qr/Cleaning up the CONTEXT stack/, 
exit => 1 },
-        'Outdated module fails with RELEASE_TESTING',
-      );
-    }
-
-    next
-      unless @load;
-
-    $check->(
-      [$missing, '--plan'],
-      qr/# skip/,
-      'Missing module skips with plan',
-    );
-    $check->(
-      [$missing, '--no_plan'],
-      qr/# skip/,
-      'Missing module skips with no_plan',
-    );
-    SKIP: {
-      skip 'Test::More too old to run tests without plan', 2
-        if !Test::More->can('done_testing');
-      $check->(
-        [$missing, '--tests'],
-        qr/# skip/,
-        'Missing module skips with tests',
-      );
-    }
-    $check->(
-      [$missing, '--plan', '--tests'],
-      qr/# skip/,
-      'Missing module passes with plan and tests',
-    );
-    $check->(
-      [$missing, '--no_plan', '--tests'],
-      qr/# skip/,
-      'Missing module passes with no_plan and tests',
-    );
-
-    SKIP: {
-      skip 'Test::More too old to run subtests', 21
-        if !Test::More->can('subtest');
-
-      $check->(
-        [$missing, '--subtest'],
-        qr/^ +1\.\.0 # SKIP/mi,
-        'Missing module skips in subtest',
-      );
-      $check->(
-        ['BrokenModule', '--subtest'],
-        { match => qr/syntax error/, exit => 1 },
-        'Broken module dies in subtest',
-      );
-      $check->(
-        ['ModuleWithVersion', '--subtest'],
-        [ qr/^ +1\.\.(?!0 # SKIP)/mi, qr/^ok[^\n#]+(?!# skip)/m ],
-        'Working module runs in subtest',
-      );
-      $check->(
-        ['ModuleWithVersion', 2, '--subtest'],
-        qr/^ +1\.\.0 # SKIP/mi,
-        'Outdated module skips in subtest',
-      );
-
-      $check->(
-        [$missing, '--subtest', '--plan'],
-        qr/# skip/,
-        'Missing module skips with plan in subtest',
-      );
-      $check->(
-        [$missing, '--subtest', '--no_plan'],
-        qr/# skip/,
-        'Missing module skips with no_plan in subtest',
-      );
-      $check->(
-        [$missing, '--subtest', '--tests'],
-        qr/# skip/,
-        'Missing module skips with tests in subtest',
-      );
-      $check->(
-        [$missing, '--subtest', '--plan', '--tests'],
-        qr/# skip/,
-        'Missing module passes with plan and tests in subtest',
-      );
-      $check->(
-        [$missing, '--subtest', '--no_plan', '--tests'],
-        qr/# skip/,
-        'Missing module passes with no_plan and tests in subtest',
-      );
-
-      local $ENV{RELEASE_TESTING} = 1;
-      $check->(
-        [$missing, '--subtest'],
-        { match => qr/^ +not ok/m, exit => 1 },
-        'Missing module fails in subtest with RELEASE_TESTING',
-      );
-    }
-  }
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/t/lib/TestAPI.pm 
new/Test-Needs-0.002010/t/lib/TestAPI.pm
--- old/Test-Needs-0.002009/t/lib/TestAPI.pm    1970-01-01 01:00:00.000000000 
+0100
+++ new/Test-Needs-0.002010/t/lib/TestAPI.pm    2023-01-22 10:21:46.000000000 
+0100
@@ -0,0 +1,268 @@
+package TestAPI;
+use strict;
+use warnings;
+use Test::More;
+use IPC::Open3;
+use Config ();
+
+my @perl = $^X =~ /(.*)/s;
+
+{
+  my $taint;
+  local $^W = 0;
+  local $@;
+  local $SIG{__DIE__};
+  local $SIG{__WARN__} = sub {
+    $taint = 1;
+    push @perl, '-t';
+  };
+  if (!eval { eval substr($ENV{PATH}, 0, 0); 1 }) {
+    $taint = 1;
+    push @perl, '-T';
+  }
+  if ($taint) {
+    $ENV{PATH} = '/';
+    delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+  }
+}
+
+my %inc;
+{
+  my $cmd = join ' ', map qq{"$_"}, @perl, '-le', 'print for @INC';
+  my @inc = `$cmd`;
+  chomp @inc;
+  @inc{@inc} = ();
+}
+my @need_inc;
+my $i = -1;
+push @need_inc, $INC[$i]
+  while ++$i < @INC && !exists $inc{$INC[$i]};
+
+my $inc_extension = 
qr/[\\\/]\Q$Config::Config{archname}\E|[\\\/]\Q$Config::Config{version}\E(?:[\\\/]\Q$Config::Config{archname}\E)?/;
+
+my $bare;
+for my $path (@need_inc) {
+  unless (defined $bare and $path =~ /\A\Q$bare\E$inc_extension\z/) {
+    $bare = $path;
+    push @perl, "-I$path";
+  }
+}
+
+push @perl, "-It/lib";
+
+my $missing = "Module::Does::Not::Exist::".time;
+
+sub capture {
+  my $pid = open3 my $stdin, my $stdout, undef, @_
+    or die "can't run @_: $!";
+  my $out = do { local $/; <$stdout> };
+  close $stdout;
+  waitpid $pid, 0;
+  my $exit = $?;
+  $out =~ s{^Possible precedence issue with control flow operator at 
.*Test/Builder\.pm.*\n}{};
+  return wantarray ? ($exit, $out) : $exit;
+}
+
+BEGIN {
+  *note = sub { print '# '.join('', @_)."\n" }
+    if !defined &note;
+}
+
+sub check {
+  my ($load, $args, $match, $name) = @_;
+  my ($label, @load) = @$load;
+  my @args = ((map "--load=$_", @load), @$args);
+  my ($exit, $out)
+    = capture @perl, '-MTestScript' . (@args ? '='.join(',', @args) : '');
+  $name = "$label: $name";
+  my $want_exit;
+  my $unmatch;
+  if (ref $match eq 'HASH') {
+    $want_exit = $match->{exit};
+    $unmatch = $match->{unmatch};
+    $match = $match->{match};
+  }
+  $match   = !defined $match    ? [] : ref $match eq 'ARRAY'    ? $match    : 
[$match];
+  $unmatch = !defined $unmatch  ? [] : ref $unmatch eq 'ARRAY'  ? $unmatch  : 
[$unmatch];
+  if (!is $exit == 0, !$want_exit, "$name - exit status") {
+    ok 0, $name
+      for 1, 0 .. $#$match, 0 .. $#$unmatch;
+    diag "Exit status $exit\nOutput:\n$out";
+    return;
+  }
+
+  my $plan_count = () = $out =~ /^[0-9]+\.\.[0-9]+(?: |$)/mg;
+  if (!ok $plan_count <= 1, "$name - no excess plans") {
+    ok 0, $name
+      for 0 .. $#$match, 0 .. $#$unmatch;
+    diag "Output:\n$out";
+    return;
+  }
+
+  for my $m (@$match) {
+    like $out, $m, $name;
+  }
+  for my $um (@$unmatch) {
+    unlike $out, $um, $name;
+  }
+}
+
+sub test_api {
+  my ($label, @load) = @_;
+  local $ENV{RELEASE_TESTING};
+  delete $ENV{RELEASE_TESTING};
+
+  my @using = map {
+    my ($e, $o) = capture @perl, "-m$_", "-eprint+$_->VERSION";
+    $e ? () : "$_ $o";
+  } @load;
+
+  if (@using != @load) {
+    plan skip_all => "$label not available";
+    return;
+  }
+
+  plan tests => ( 14*3 + 1*4 ) * !!@load + (7*3 + 1*4);
+
+  note "Checking against ".join(', ', @using)."\n"
+    if @using;
+
+  check([@_],
+    [$missing],
+    qr/^1\.\.0 # SKIP/i,
+    'Missing module SKIPs',
+  );
+  check([@_],
+    ['BrokenModule'],
+    { match => qr/syntax error/, exit => 1 },
+    'Broken module dies',
+  );
+  check([@_],
+    ['ModuleWithVersion'],
+    qr/^(?!1\.\.0 # SKIP)/i,
+    'Working module runs',
+  );
+  check([@_],
+    ['ModuleWithVersion', 2],
+    qr/^1\.\.0 # SKIP/i,
+    'Outdated module SKIPs',
+  );
+
+  {
+    local $ENV{RELEASE_TESTING} = 1;
+    check([@_],
+      [$missing],
+      { match => qr/^not ok/m, exit => 1 },
+      'Missing module fails with RELEASE_TESTING',
+    );
+    check([@_],
+      ['BrokenModule'],
+      { match => qr/syntax error/, exit => 1 },
+      'Broken module dies with RELEASE_TESTING',
+    );
+    check([@_],
+      ['ModuleWithVersion'],
+      qr/^(?!1\.\.0 # SKIP)/i,
+      'Working module runs with RELEASE_TESTING',
+    );
+    check([@_],
+      ['ModuleWithVersion', 2],
+      { match => qr/^not ok/m, unmatch => qr/Cleaning up the CONTEXT stack/, 
exit => 1 },
+      'Outdated module fails with RELEASE_TESTING',
+    );
+  }
+
+  return
+    unless @load;
+
+  check([@_],
+    [$missing, '--plan'],
+    qr/# skip/,
+    'Missing module skips with plan',
+  );
+  check([@_],
+    [$missing, '--no_plan'],
+    qr/# skip/,
+    'Missing module skips with no_plan',
+  );
+  SKIP: {
+    skip 'Test::More too old to run tests without plan', 3
+      if !Test::More->can('done_testing');
+    check([@_],
+      [$missing, '--tests'],
+      qr/# skip/,
+      'Missing module skips with tests',
+    );
+  }
+  check([@_],
+    [$missing, '--plan', '--tests'],
+    qr/# skip/,
+    'Missing module passes with plan and tests',
+  );
+  check([@_],
+    [$missing, '--no_plan', '--tests'],
+    qr/# skip/,
+    'Missing module passes with no_plan and tests',
+  );
+
+  SKIP: {
+    skip 'Test::More too old to run subtests', 9*3 + 1*4
+      if !Test::More->can('subtest');
+
+    check([@_],
+      [$missing, '--subtest'],
+      qr/^ +1\.\.0 # SKIP/mi,
+      'Missing module skips in subtest',
+    );
+    check([@_],
+      ['BrokenModule', '--subtest'],
+      { match => qr/syntax error/, exit => 1 },
+      'Broken module dies in subtest',
+    );
+    check([@_],
+      ['ModuleWithVersion', '--subtest'],
+      [ qr/^ +1\.\.(?!0 # SKIP)/mi, qr/^ok[^\n#]+(?!# skip)/m ],
+      'Working module runs in subtest',
+    );
+    check([@_],
+      ['ModuleWithVersion', 2, '--subtest'],
+      qr/^ +1\.\.0 # SKIP/mi,
+      'Outdated module skips in subtest',
+    );
+
+    check([@_],
+      [$missing, '--subtest', '--plan'],
+      qr/# skip/,
+      'Missing module skips with plan in subtest',
+    );
+    check([@_],
+      [$missing, '--subtest', '--no_plan'],
+      qr/# skip/,
+      'Missing module skips with no_plan in subtest',
+    );
+    check([@_],
+      [$missing, '--subtest', '--tests'],
+      qr/# skip/,
+      'Missing module skips with tests in subtest',
+    );
+    check([@_],
+      [$missing, '--subtest', '--plan', '--tests'],
+      qr/# skip/,
+      'Missing module passes with plan and tests in subtest',
+    );
+    check([@_],
+      [$missing, '--subtest', '--no_plan', '--tests'],
+      qr/# skip/,
+      'Missing module passes with no_plan and tests in subtest',
+    );
+
+    local $ENV{RELEASE_TESTING} = 1;
+    check([@_],
+      [$missing, '--subtest'],
+      { match => qr/^ +not ok/m, exit => 1 },
+      'Missing module fails in subtest with RELEASE_TESTING',
+    );
+  }
+}
+
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/t/standalone.t 
new/Test-Needs-0.002010/t/standalone.t
--- old/Test-Needs-0.002009/t/standalone.t      1970-01-01 01:00:00.000000000 
+0100
+++ new/Test-Needs-0.002010/t/standalone.t      2023-01-22 10:13:17.000000000 
+0100
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use TestAPI;
+TestAPI::test_api('standalone');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/t/test-builder.t 
new/Test-Needs-0.002010/t/test-builder.t
--- old/Test-Needs-0.002009/t/test-builder.t    1970-01-01 01:00:00.000000000 
+0100
+++ new/Test-Needs-0.002010/t/test-builder.t    2023-01-22 10:14:31.000000000 
+0100
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use TestAPI;
+TestAPI::test_api('Test::Builder' => 'Test::Builder');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Needs-0.002009/t/test2.t 
new/Test-Needs-0.002010/t/test2.t
--- old/Test-Needs-0.002009/t/test2.t   1970-01-01 01:00:00.000000000 +0100
+++ new/Test-Needs-0.002010/t/test2.t   2023-01-22 10:13:59.000000000 +0100
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use TestAPI;
+TestAPI::test_api('Test2' => 'Test2::API');

Reply via email to