This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Test-Simple to CPAN version 1.302166
authorChad Granum <exodist7@gmail.com>
Mon, 19 Aug 2019 21:32:29 +0000 (17:32 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Mon, 19 Aug 2019 21:32:29 +0000 (17:32 -0400)
1.302166  2019-08-15 10:37:01-07:00 America/Los_Angeles

    - Fix context test on older perls

1.302165  2019-08-15 10:21:09-07:00 America/Los_Angeles

    - Better diagnostics when a context is destroyed unexpectedly
    - Add an event to notify when END phase starts

68 files changed:
Porting/Maintainers.pl
cpan/Test-Simple/lib/Test/Builder.pm
cpan/Test-Simple/lib/Test/Builder/Formatter.pm
cpan/Test-Simple/lib/Test/Builder/Module.pm
cpan/Test-Simple/lib/Test/Builder/Tester.pm
cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm
cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm
cpan/Test-Simple/lib/Test/More.pm
cpan/Test-Simple/lib/Test/Simple.pm
cpan/Test-Simple/lib/Test/Tester.pm
cpan/Test-Simple/lib/Test/Tester/Capture.pm
cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm
cpan/Test-Simple/lib/Test/Tester/Delegate.pm
cpan/Test-Simple/lib/Test/use/ok.pm
cpan/Test-Simple/lib/Test2.pm
cpan/Test-Simple/lib/Test2/API.pm
cpan/Test-Simple/lib/Test2/API/Breakage.pm
cpan/Test-Simple/lib/Test2/API/Context.pm
cpan/Test-Simple/lib/Test2/API/Instance.pm
cpan/Test-Simple/lib/Test2/API/Stack.pm
cpan/Test-Simple/lib/Test2/Event.pm
cpan/Test-Simple/lib/Test2/Event/Bail.pm
cpan/Test-Simple/lib/Test2/Event/Diag.pm
cpan/Test-Simple/lib/Test2/Event/Encoding.pm
cpan/Test-Simple/lib/Test2/Event/Exception.pm
cpan/Test-Simple/lib/Test2/Event/Fail.pm
cpan/Test-Simple/lib/Test2/Event/Generic.pm
cpan/Test-Simple/lib/Test2/Event/Note.pm
cpan/Test-Simple/lib/Test2/Event/Ok.pm
cpan/Test-Simple/lib/Test2/Event/Pass.pm
cpan/Test-Simple/lib/Test2/Event/Plan.pm
cpan/Test-Simple/lib/Test2/Event/Skip.pm
cpan/Test-Simple/lib/Test2/Event/Subtest.pm
cpan/Test-Simple/lib/Test2/Event/TAP/Version.pm
cpan/Test-Simple/lib/Test2/Event/V2.pm
cpan/Test-Simple/lib/Test2/Event/Waiting.pm
cpan/Test-Simple/lib/Test2/EventFacet.pm
cpan/Test-Simple/lib/Test2/EventFacet/About.pm
cpan/Test-Simple/lib/Test2/EventFacet/Amnesty.pm
cpan/Test-Simple/lib/Test2/EventFacet/Assert.pm
cpan/Test-Simple/lib/Test2/EventFacet/Control.pm
cpan/Test-Simple/lib/Test2/EventFacet/Error.pm
cpan/Test-Simple/lib/Test2/EventFacet/Hub.pm
cpan/Test-Simple/lib/Test2/EventFacet/Info.pm
cpan/Test-Simple/lib/Test2/EventFacet/Info/Table.pm
cpan/Test-Simple/lib/Test2/EventFacet/Meta.pm
cpan/Test-Simple/lib/Test2/EventFacet/Parent.pm
cpan/Test-Simple/lib/Test2/EventFacet/Plan.pm
cpan/Test-Simple/lib/Test2/EventFacet/Render.pm
cpan/Test-Simple/lib/Test2/EventFacet/Trace.pm
cpan/Test-Simple/lib/Test2/Formatter.pm
cpan/Test-Simple/lib/Test2/Formatter/TAP.pm
cpan/Test-Simple/lib/Test2/Hub.pm
cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm
cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm
cpan/Test-Simple/lib/Test2/Hub/Subtest.pm
cpan/Test-Simple/lib/Test2/IPC.pm
cpan/Test-Simple/lib/Test2/IPC/Driver.pm
cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm
cpan/Test-Simple/lib/Test2/Tools/Tiny.pm
cpan/Test-Simple/lib/Test2/Util.pm
cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm
cpan/Test-Simple/lib/Test2/Util/Facets2Legacy.pm
cpan/Test-Simple/lib/Test2/Util/HashBase.pm
cpan/Test-Simple/lib/Test2/Util/Trace.pm
cpan/Test-Simple/lib/ok.pm
cpan/Test-Simple/t/Test2/modules/API/Context.t
cpan/Test-Simple/t/regression/errors_facet.t

index e3528c7..40b1979 100755 (executable)
@@ -1043,7 +1043,7 @@ use File::Glob qw(:case);
     },
 
     'Test::Simple' => {
-        'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302164.tar.gz',
+        'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302166.tar.gz',
         'FILES'        => q[cpan/Test-Simple],
         'EXCLUDED'     => [
             qr{^examples/},
index 29f527c..b758c4a 100644 (file)
@@ -4,7 +4,7 @@ use 5.006;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN {
     if( $] < 5.008 ) {
@@ -391,7 +391,7 @@ sub name {
 sub reset {    ## no critic (Subroutines::ProhibitBuiltinHomonyms)
     my ($self, %params) = @_;
 
-    Test2::API::test2_set_is_end(0);
+    Test2::API::test2_unset_is_end();
 
     # We leave this a global because it has to be localized and localizing
     # hash keys is just asking for pain.  Also, it was documented.
index 65b1820..2f88c83 100644 (file)
@@ -2,7 +2,7 @@ package Test::Builder::Formatter;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) }
 
index c941681..968fe98 100644 (file)
@@ -7,7 +7,7 @@ use Test::Builder;
 require Exporter;
 our @ISA = qw(Exporter);
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 =head1 NAME
index 64b5e3f..e905061 100644 (file)
@@ -1,7 +1,7 @@
 package Test::Builder::Tester;
 
 use strict;
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test::Builder;
 use Symbol;
index bbbf1d6..be36ecd 100644 (file)
@@ -1,7 +1,7 @@
 package Test::Builder::Tester::Color;
 
 use strict;
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 require Test::Builder::Tester;
 
index 2fedaa8..fafc67d 100644 (file)
@@ -2,7 +2,7 @@ package Test::Builder::TodoDiag;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) }
 
index ebde89c..5088441 100644 (file)
@@ -17,7 +17,7 @@ sub _carp {
     return warn @_, " at $file line $line\n";
 }
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test::Builder::Module;
 our @ISA    = qw(Test::Builder::Module);
index 24a7f53..0e94c5f 100644 (file)
@@ -4,7 +4,7 @@ use 5.006;
 
 use strict;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test::Builder::Module;
 our @ISA    = qw(Test::Builder::Module);
index 40e334e..aebf1b4 100644 (file)
@@ -18,7 +18,7 @@ require Exporter;
 
 use vars qw( @ISA @EXPORT );
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 @EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
 @ISA = qw( Exporter );
index 929b12b..af6bac0 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 
 package Test::Tester::Capture;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test::Builder;
index b8f1460..0bcb9e2 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 
 package Test::Tester::CaptureRunner;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test::Tester::Capture;
index b287463..03ee047 100644 (file)
@@ -3,7 +3,7 @@ use warnings;
 
 package Test::Tester::Delegate;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Scalar::Util();
 
index fa376b0..2f7f503 100644 (file)
@@ -1,7 +1,7 @@
 package Test::use::ok;
 use 5.005;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 __END__
index 95afc4b..26efa43 100644 (file)
@@ -2,7 +2,7 @@ package Test2;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 1;
index 745da15..dc76659 100644 (file)
@@ -9,14 +9,42 @@ BEGIN {
     $ENV{TEST2_ACTIVE} = 1;
 }
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 my $INST;
 my $ENDING = 0;
-sub test2_set_is_end { ($ENDING) = @_ ? @_ : (1) }
+sub test2_unset_is_end { $ENDING = 0 }
 sub test2_get_is_end { $ENDING }
 
+sub test2_set_is_end {
+    my $before = $ENDING;
+    ($ENDING) = @_ ? @_ : (1);
+
+    # Only send the event in a transition from false to true
+    return if $before;
+    return unless $ENDING;
+
+    return unless $INST;
+    my $stack = $INST->stack or return;
+    my $root = $stack->root or return;
+
+    return unless $$ == $INST->pid;
+    return unless get_tid() == $INST->tid;
+
+    my $trace = Test2::EventFacet::Trace->new(
+        frame  => [__PACKAGE__, __FILE__, __LINE__, __PACKAGE__ . '::test2_set_is_end'],
+    );
+    my $ctx = Test2::API::Context->new(
+        trace => $trace,
+        hub   => $root,
+    );
+
+    $ctx->send_ev2(control => { phase => 'END', details => 'Transition to END phase' });
+
+    1;
+}
+
 use Test2::API::Instance(\$INST);
 
 # Set the exit status
@@ -87,6 +115,7 @@ our @EXPORT_OK = qw{
     test2_in_preload
 
     test2_set_is_end
+    test2_unset_is_end
     test2_get_is_end
 
     test2_pid
index be92ec1..106748a 100644 (file)
@@ -2,7 +2,7 @@ package Test2::API::Breakage;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test2::Util qw/pkg_to_file/;
index e329346..f1a6237 100644 (file)
@@ -2,7 +2,7 @@ package Test2::API::Context;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Carp qw/confess croak/;
@@ -71,6 +71,8 @@ sub DESTROY {
         # show the warning about using eq.
         no warnings 'uninitialized';
         if($self->{+EVAL_ERROR} eq $@ && $hub->is_local) {
+            require Carp;
+            my $mess = Carp::longmess("Context destroyed");
             my $frame = $self->{+_IS_SPAWN} || $self->{+TRACE}->frame;
             warn <<"            EOT";
 A context appears to have been destroyed without first calling release().
@@ -87,6 +89,10 @@ release():
   Line: $frame->[2]
   Tool: $frame->[3]
 
+Here is a trace to the code that caused the context to be destroyed, this could
+be an exit(), a goto, or simply the end of a scope:
+$mess
+
 Cleaning up the CONTEXT stack...
             EOT
         }
index 37ad258..4ee5512 100644 (file)
@@ -2,7 +2,7 @@ package Test2::API::Instance;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/;
 use Carp qw/confess carp/;
index 3cd0a3a..5326e33 100644 (file)
@@ -2,7 +2,7 @@ package Test2::API::Stack;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test2::Hub();
@@ -63,6 +63,12 @@ sub all {
     return @$self;
 }
 
+sub root {
+    my $self = shift;
+    return unless @$self;
+    return $self->[0];
+}
+
 sub clear {
     my $self = shift;
     @$self = ();
index a7376eb..7ff8052 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Scalar::Util qw/blessed reftype/;
 use Carp qw/croak/;
@@ -526,11 +526,11 @@ perhaps to say that an event of an unknown type was seen.
 Facets are produced by the C<facet_data()> subroutine, which you should
 nearly-always override. C<facet_data()> is expected to return a hashref where
 each key is the facet type, and the value is either a hashref with the data for
-that facet, or an array of hashref's. Some facets must be defined as single
+that facet, or an array of hashrefs. Some facets must be defined as single
 hashrefs, some must be defined as an array of hashrefs, No facets allow both.
 
 C<facet_data()> B<MUST NOT> bless the data it returns, the main hashref, and
-nested facet hashref's B<MUST> be bare, though items contained within each
+nested facet hashrefs B<MUST> be bare, though items contained within each
 facet may be blessed. The data returned by this method B<should> also be copies
 of the internal data in order to prevent accidental state modification.
 
index af14d10..6862884 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Bail;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index 06b0df8..24a5693 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Diag;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index a04bcd2..b5213dd 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Encoding;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Carp qw/croak/;
 
index c7a2e4f..7a35e0e 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Exception;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index 1a040b2..ad71cdc 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Fail;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test2::EventFacet::Info;
 
index d95ab53..3f2b5fd 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 use Carp qw/croak/;
 use Scalar::Util qw/reftype/;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
 use Test2::Util::HashBase;
index 30d8744..fc2299d 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Note;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index 3966f86..3b92623 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Ok;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index 14c5eb8..bc42820 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Pass;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test2::EventFacet::Info;
 
index dd9c076..e470980 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Plan;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index 28204a1..2f01bf8 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Skip;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
index 01a5115..9f39997 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Subtest;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
 use Test2::Util::HashBase qw{subevents buffered subtest_id subtest_uuid};
index a018df5..0a22f97 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::TAP::Version;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Carp qw/croak/;
 
index 451a8d2..cfe6eba 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::V2;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Scalar::Util qw/reftype/;
 use Carp qw/croak/;
index df0fc1c..5d3c378 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Event::Waiting;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
index efe1e84..657ca1f 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test2::Util::HashBase qw/-details/;
 use Carp qw/croak/;
index fa7ea1e..4121ce1 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::About;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
 use Test2::Util::HashBase qw{ -package -no_display -uuid -eid };
index adf9e30..cc43608 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Amnesty;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 sub is_list { 1 }
 
index 3fb85dc..2ec49c1 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Assert;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
 use Test2::Util::HashBase qw{ -pass -no_debug -number };
index 10e055f..ac7d7e9 100644 (file)
@@ -2,10 +2,10 @@ package Test2::EventFacet::Control;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
-use Test2::Util::HashBase qw{ -global -terminate -halt -has_callback -encoding };
+use Test2::Util::HashBase qw{ -global -terminate -halt -has_callback -encoding -phase };
 
 1;
 
@@ -65,6 +65,13 @@ True if the C<callback($hub)> method on the event should be called.
 
 This can be used to change the encoding from this event onward.
 
+=item $phase = $control->{phase}
+
+=item $phase = $control->phase()
+
+Used to signal that a phase change has occurred. Currently only the perl END
+phase is signaled.
+
 =back
 
 =head1 SOURCE
index 6cdb19a..2949814 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Error;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 sub facet_key { 'errors' }
 sub is_list { 1 }
index 61a3289..b36d57d 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Hub;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 sub is_list { 1 }
 sub facet_key { 'hubs' }
index a7c003e..0eaa66d 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Info;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 sub is_list { 1 }
 
index 6e33cd7..c7c2179 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Info::Table;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Carp qw/confess/;
 
index c028ba7..80635c8 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Meta;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
 use vars qw/$AUTOLOAD/;
index 0757daf..c05113a 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Parent;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Carp qw/confess/;
 
index f1f7cbf..9afcb4e 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Plan;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
 use Test2::Util::HashBase qw{ -count -skip -none };
index ddb0495..cee1729 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Render;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 sub is_list { 1 }
 
index b32378a..0ff6274 100644 (file)
@@ -2,7 +2,7 @@ package Test2::EventFacet::Trace;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
 
index a4d4306..f88ea97 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Formatter;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 my %ADDED;
index a1194cd..59e2a6f 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Formatter::TAP;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Test2::Util qw/clone_io/;
 
index ff4cb82..82d3192 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Hub;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Carp qw/carp croak confess/;
index b7eaa0f..441a55e 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Hub::Interceptor;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test2::Hub::Interceptor::Terminator();
index c308703..650b413 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Hub::Interceptor::Terminator;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 1;
index 60937a1..8d29b1e 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Hub::Subtest;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) }
 use Test2::Util::HashBase qw/nested exit_code manual_skip_all/;
index b6cd999..c3ad748 100644 (file)
@@ -2,7 +2,7 @@ package Test2::IPC;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Test2::API::Instance;
index 3ee1d76..373f41a 100644 (file)
@@ -2,7 +2,7 @@ package Test2::IPC::Driver;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Carp qw/confess/;
index 3b8574b..784faca 100644 (file)
@@ -2,7 +2,7 @@ package Test2::IPC::Driver::Files;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) }
 
index 89018a9..2d5eda4 100644 (file)
@@ -16,7 +16,7 @@ use Test2::API qw/context run_subtest test2_stack/;
 use Test2::Hub::Interceptor();
 use Test2::Hub::Interceptor::Terminator();
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 BEGIN { require Exporter; our @ISA = qw(Exporter) }
 our @EXPORT = qw{
index 55c85a0..8574033 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Util;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use POSIX();
 use Config qw/%Config/;
index 611d47f..e262b6a 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Util::ExternalMeta;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 
 use Carp qw/croak/;
index 28a36da..a2c25f4 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Util::Facets2Legacy;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use Carp qw/croak confess/;
 use Scalar::Util qw/blessed/;
index 99ca8de..654b768 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Util::HashBase;
 use strict;
 use warnings;
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 #################################################################
 #                                                               #
index 02d385b..dffe5fa 100644 (file)
@@ -2,7 +2,7 @@ package Test2::Util::Trace;
 require Test2::EventFacet::Trace;
 @ISA = ('Test2::EventFacet::Trace');
 
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 1;
 
index 4fe4154..4552d9a 100644 (file)
@@ -1,5 +1,5 @@
 package ok;
-our $VERSION = '1.302164';
+our $VERSION = '1.302166';
 
 use strict;
 use Test::More ();
index 207f3d0..b17dd20 100644 (file)
@@ -477,4 +477,30 @@ sub {
 
 }->();
 
+sub ctx_destroy_test {
+    my (undef, undef, $line1) = caller();
+    my (@warn, $line2);
+    local $SIG{__WARN__} = sub { push @warn => $_[0] };
+
+    { my $ctx = context(); $ctx = undef } $line2 = __LINE__;
+
+    use Data::Dumper;
+#    print Dumper(@warn);
+
+    like($warn[0], qr/context appears to have been destroyed without first calling release/, "Is normal context warning");
+    like($warn[0], qr{\QContext destroyed at ${ \__FILE__ } line $line2\E}, "Reported context destruction trace");
+
+    my $created = <<"    EOT";
+Here are the context creation details, just in case a tool forgot to call
+release():
+  File: ${ \__FILE__ }
+  Line: $line1
+  Tool: main::ctx_destroy_test
+    EOT
+
+    like($warn[0], qr{\Q$created\E}, "Reported context creation details");
+};
+
+ctx_destroy_test();
+
 done_testing;
index c4e30f9..6427ba2 100644 (file)
@@ -14,7 +14,7 @@ use Test2::API qw/intercept context/;
 
         my $out = $self->common_facet_data;
 
-        $out->{errors} = [{tag => 'OOPS', fail => !$ENV{FAILURE_DO_PASS}, details => "An error occured"}];
+        $out->{errors} = [{tag => 'OOPS', fail => !$ENV{FAILURE_DO_PASS}, details => "An error occurred"}];
 
         return $out;
     }