Hello community, here is the log from the commit of package perl-Test-Simple for openSUSE:Factory checked in at 2018-03-08 10:55:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Simple (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Simple.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Simple" Thu Mar 8 10:55:16 2018 rev:13 rq:583225 version:1.302128 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Simple/perl-Test-Simple.changes 2018-02-26 23:22:48.991373499 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Test-Simple.new/perl-Test-Simple.changes 2018-03-08 10:55:18.674063577 +0100 @@ -1,0 +2,18 @@ +Tue Mar 6 07:04:37 UTC 2018 - co...@suse.com + +- updated to 1.302128 + see /usr/share/doc/packages/perl-Test-Simple/Changes + + 1.302128 2018-03-05 09:26:53-08:00 America/Los_Angeles + + - No changes since the trial + + 1.302127 2018-03-02 12:43:56-08:00 America/Los_Angeles (TRIAL RELEASE) + + - Fix missing UUID in Test::Builder subtests + + 1.302126 2018-03-01 23:15:52-08:00 America/Los_Angeles (TRIAL RELEASE) + + - Add optional UUID tagging + +------------------------------------------------------------------- Old: ---- Test-Simple-1.302125.tar.gz New: ---- Test-Simple-1.302128.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Simple.spec ++++++ --- /var/tmp/diff_new_pack.5mq4qx/_old 2018-03-08 10:55:20.098012317 +0100 +++ /var/tmp/diff_new_pack.5mq4qx/_new 2018-03-08 10:55:20.098012317 +0100 @@ -17,7 +17,7 @@ Name: perl-Test-Simple -Version: 1.302125 +Version: 1.302128 Release: 0 %define cpan_name Test-Simple Summary: Basic utilities for writing tests ++++++ Test-Simple-1.302125.tar.gz -> Test-Simple-1.302128.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/Changes new/Test-Simple-1.302128/Changes --- old/Test-Simple-1.302125/Changes 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/Changes 2018-03-05 18:26:54.000000000 +0100 @@ -1,3 +1,15 @@ +1.302128 2018-03-05 09:26:53-08:00 America/Los_Angeles + + - No changes since the trial + +1.302127 2018-03-02 12:43:56-08:00 America/Los_Angeles (TRIAL RELEASE) + + - Fix missing UUID in Test::Builder subtests + +1.302126 2018-03-01 23:15:52-08:00 America/Los_Angeles (TRIAL RELEASE) + + - Add optional UUID tagging + 1.302125 2018-02-21 23:10:39-08:00 America/Los_Angeles - No changes since trial diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/MANIFEST new/Test-Simple-1.302128/MANIFEST --- old/Test-Simple-1.302125/MANIFEST 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/MANIFEST 2018-03-05 18:26:54.000000000 +0100 @@ -242,6 +242,7 @@ t/Test2/behavior/special_names.t t/Test2/behavior/subtest_bailout.t t/Test2/behavior/trace_signature.t +t/Test2/behavior/uuid.t t/Test2/legacy/TAP.t t/Test2/modules/API.t t/Test2/modules/API/Breakage.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/META.json new/Test-Simple-1.302128/META.json --- old/Test-Simple-1.302125/META.json 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/META.json 2018-03-05 18:26:54.000000000 +0100 @@ -47,7 +47,7 @@ "url" : "http://github.com/Test-More/test-more/" } }, - "version" : "1.302125", + "version" : "1.302128", "x_breaks" : { "Log::Dispatch::Config::TestLog" : "<= 0.02", "Net::BitTorrent" : "<= 0.052", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/META.yml new/Test-Simple-1.302128/META.yml --- old/Test-Simple-1.302125/META.yml 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/META.yml 2018-03-05 18:26:54.000000000 +0100 @@ -22,7 +22,7 @@ resources: bugtracker: http://github.com/Test-More/test-more/issues repository: http://github.com/Test-More/test-more/ -version: '1.302125' +version: '1.302128' x_breaks: Log::Dispatch::Config::TestLog: '<= 0.02' Net::BitTorrent: '<= 0.052' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/Makefile.PL new/Test-Simple-1.302128/Makefile.PL --- old/Test-Simple-1.302125/Makefile.PL 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/Makefile.PL 2018-03-05 18:26:54.000000000 +0100 @@ -23,7 +23,7 @@ "Storable" => 0, "utf8" => 0 }, - "VERSION" => "1.302125", + "VERSION" => "1.302128", "test" => { "TESTS" => "t/*.t t/Legacy/*.t t/Legacy/Bugs/*.t t/Legacy/Builder/*.t t/Legacy/Regression/*.t t/Legacy/Simple/*.t t/Legacy/Test2/*.t t/Legacy/Tester/*.t t/Legacy/subtest/*.t t/Legacy_And_Test2/*.t t/Test2/acceptance/*.t t/Test2/behavior/*.t t/Test2/legacy/*.t t/Test2/modules/*.t t/Test2/modules/API/*.t t/Test2/modules/Event/*.t t/Test2/modules/Event/TAP/*.t t/Test2/modules/EventFacet/*.t t/Test2/modules/Formatter/*.t t/Test2/modules/Hub/*.t t/Test2/modules/Hub/Interceptor/*.t t/Test2/modules/IPC/*.t t/Test2/modules/IPC/Driver/*.t t/Test2/modules/Tools/*.t t/Test2/modules/Util/*.t t/Test2/regression/*.t t/regression/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder/Formatter.pm new/Test-Simple-1.302128/lib/Test/Builder/Formatter.pm --- old/Test-Simple-1.302125/lib/Test/Builder/Formatter.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder/Formatter.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder/Module.pm new/Test-Simple-1.302128/lib/Test/Builder/Module.pm --- old/Test-Simple-1.302125/lib/Test/Builder/Module.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder/Module.pm 2018-03-05 18:26:54.000000000 +0100 @@ -7,7 +7,7 @@ require Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; =head1 NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder/Tester/Color.pm new/Test-Simple-1.302128/lib/Test/Builder/Tester/Color.pm --- old/Test-Simple-1.302125/lib/Test/Builder/Tester/Color.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder/Tester/Color.pm 2018-03-05 18:26:54.000000000 +0100 @@ -1,7 +1,7 @@ package Test::Builder::Tester::Color; use strict; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; require Test::Builder::Tester; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder/Tester.pm new/Test-Simple-1.302128/lib/Test/Builder/Tester.pm --- old/Test-Simple-1.302125/lib/Test/Builder/Tester.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder/Tester.pm 2018-03-05 18:26:54.000000000 +0100 @@ -1,7 +1,7 @@ package Test::Builder::Tester; use strict; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test::Builder; use Symbol; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder/TodoDiag.pm new/Test-Simple-1.302128/lib/Test/Builder/TodoDiag.pm --- old/Test-Simple-1.302125/lib/Test/Builder/TodoDiag.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder/TodoDiag.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Builder.pm new/Test-Simple-1.302128/lib/Test/Builder.pm --- old/Test-Simple-1.302125/lib/Test/Builder.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Builder.pm 2018-03-05 18:26:54.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { if( $] < 5.008 ) { @@ -221,6 +221,7 @@ $meta->{Test_Results} = []; $meta->{subevents} = $subevents; $meta->{subtest_id} = $hub->id; + $meta->{subtest_uuid} = $hub->uuid; $meta->{subtest_buffered} = $parent->format ? 0 : 1; $self->_add_ts_hooks; @@ -301,6 +302,7 @@ else { $parent->{subevents} = $meta->{subevents}; $parent->{subtest_id} = $meta->{subtest_id}; + $parent->{subtest_uuid} = $meta->{subtest_uuid}; $parent->{subtest_buffered} = $meta->{subtest_buffered}; $parent->ok( $chub->is_passing, $meta->{Name} ); } @@ -671,11 +673,12 @@ my @attrs; my $subevents = delete $self->{subevents}; my $subtest_id = delete $self->{subtest_id}; + my $subtest_uuid = delete $self->{subtest_uuid}; my $subtest_buffered = delete $self->{subtest_buffered}; my $epkg = 'Test2::Event::Ok'; if ($subevents) { $epkg = 'Test2::Event::Subtest'; - push @attrs => (subevents => $subevents, subtest_id => $subtest_id, buffered => $subtest_buffered); + push @attrs => (subevents => $subevents, subtest_id => $subtest_id, subtest_uuid => $subtest_uuid, buffered => $subtest_buffered); } my $e = bless { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/More.pm new/Test-Simple-1.302128/lib/Test/More.pm --- old/Test-Simple-1.302125/lib/Test/More.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/More.pm 2018-03-05 18:26:54.000000000 +0100 @@ -17,7 +17,7 @@ return warn @_, " at $file line $line\n"; } -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Simple.pm new/Test-Simple-1.302128/lib/Test/Simple.pm --- old/Test-Simple-1.302125/lib/Test/Simple.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Simple.pm 2018-03-05 18:26:54.000000000 +0100 @@ -4,7 +4,7 @@ use strict; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Tester/Capture.pm new/Test-Simple-1.302128/lib/Test/Tester/Capture.pm --- old/Test-Simple-1.302125/lib/Test/Tester/Capture.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Tester/Capture.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ package Test::Tester::Capture; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test::Builder; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Tester/CaptureRunner.pm new/Test-Simple-1.302128/lib/Test/Tester/CaptureRunner.pm --- old/Test-Simple-1.302125/lib/Test/Tester/CaptureRunner.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Tester/CaptureRunner.pm 2018-03-05 18:26:54.000000000 +0100 @@ -3,7 +3,7 @@ package Test::Tester::CaptureRunner; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test::Tester::Capture; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Tester/Delegate.pm new/Test-Simple-1.302128/lib/Test/Tester/Delegate.pm --- old/Test-Simple-1.302125/lib/Test/Tester/Delegate.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Tester/Delegate.pm 2018-03-05 18:26:54.000000000 +0100 @@ -3,7 +3,7 @@ package Test::Tester::Delegate; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Scalar::Util(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/Tester.pm new/Test-Simple-1.302128/lib/Test/Tester.pm --- old/Test-Simple-1.302125/lib/Test/Tester.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/Tester.pm 2018-03-05 18:26:54.000000000 +0100 @@ -18,7 +18,7 @@ use vars qw( @ISA @EXPORT ); -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; @EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); @ISA = qw( Exporter ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test/use/ok.pm new/Test-Simple-1.302128/lib/Test/use/ok.pm --- old/Test-Simple-1.302125/lib/Test/use/ok.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test/use/ok.pm 2018-03-05 18:26:54.000000000 +0100 @@ -1,7 +1,7 @@ package Test::use::ok; use 5.005; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; __END__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/API/Breakage.pm new/Test-Simple-1.302128/lib/Test2/API/Breakage.pm --- old/Test-Simple-1.302125/lib/Test2/API/Breakage.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/API/Breakage.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::Util qw/pkg_to_file/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/API/Context.pm new/Test-Simple-1.302128/lib/Test2/API/Context.pm --- old/Test-Simple-1.302125/lib/Test2/API/Context.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/API/Context.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/confess croak/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/API/Instance.pm new/Test-Simple-1.302128/lib/Test2/API/Instance.pm --- old/Test-Simple-1.302125/lib/Test2/API/Instance.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/API/Instance.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/; @@ -21,6 +21,8 @@ ipc stack formatter contexts + add_uuid_via + -preload ipc_disabled @@ -98,6 +100,8 @@ delete $self->{+_PID}; delete $self->{+_TID}; + $self->{+ADD_UUID_VIA} = undef unless exists $self->{+ADD_UUID_VIA}; + $self->{+CONTEXTS} = {}; $self->{+FORMATTERS} = []; @@ -119,7 +123,9 @@ delete $self->{+_PID}; delete $self->{+_TID}; - $self->{+CONTEXTS} = {}; + $self->{+ADD_UUID_VIA} = undef; + + $self->{+CONTEXTS} = {}; $self->{+IPC_DRIVERS} = []; $self->{+IPC_POLLING} = undef; @@ -127,8 +133,8 @@ $self->{+FORMATTERS} = []; $self->{+FORMATTER} = undef; - $self->{+FINALIZED} = undef; - $self->{+IPC} = undef; + $self->{+FINALIZED} = undef; + $self->{+IPC} = undef; $self->{+IPC_DISABLED} = $ENV{T2_NO_IPC} ? 1 : 0; $self->{+IPC_TIMEOUT} = DEFAULT_IPC_TIMEOUT() unless defined $self->{+IPC_TIMEOUT}; @@ -859,6 +865,22 @@ "Formatter $formatter loaded too late to be used as the global formatter" +=item $obj->set_add_uuid_via(sub { ... }) + +=item $sub = $obj->add_uuid_via() + +This allows you to provide a UUID generator. If provided UUIDs will be attached +to all events, hubs, and contexts. This is useful for storing, tracking, and +linking these objects. + +The sub you provide should always return a unique identifier. Most things will +expect a proper UUID string, however nothing in Test2::API enforces this. + +The sub will receive exactly 1 argument, the type of thing being tagged +'context', 'hub', or 'event'. In the future additional things may be tagged, in +which case new strings will be passed in. These are purely informative, you can +(and usually should) ignore them. + =back =head1 SOURCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/API/Stack.pm new/Test-Simple-1.302128/lib/Test2/API/Stack.pm --- old/Test-Simple-1.302125/lib/Test2/API/Stack.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/API/Stack.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::Hub(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/API.pm new/Test-Simple-1.302128/lib/Test2/API.pm --- old/Test-Simple-1.302125/lib/Test2/API.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/API.pm 2018-03-05 18:26:54.000000000 +0100 @@ -9,7 +9,7 @@ $ENV{TEST2_ACTIVE} = 1; } -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; my $INST; @@ -97,6 +97,8 @@ test2_ipc_wait_disable test2_ipc_wait_enabled + test2_add_uuid_via + test2_add_callback_context_aquire test2_add_callback_context_acquire test2_add_callback_context_init @@ -193,6 +195,11 @@ sub test2_list_post_load_callbacks { @{$INST->post_load_callbacks} } sub test2_list_pre_subtest_callbacks { @{$INST->pre_subtest_callbacks} } +sub test2_add_uuid_via { + $INST->set_add_uuid_via(@_) if @_; + $INST->add_uuid_via(); +} + sub test2_ipc { $INST->ipc } sub test2_has_ipc { $INST->has_ipc } sub test2_ipc_disable { $INST->ipc_disable } @@ -233,6 +240,7 @@ sub _context_acquire_callbacks_ref { $INST->context_acquire_callbacks } sub _context_init_callbacks_ref { $INST->context_init_callbacks } sub _context_release_callbacks_ref { $INST->context_release_callbacks } +sub _add_uuid_via_ref { \($INST->{Test2::API::Instance::ADD_UUID_VIA()}) } # Private, for use in Test2::IPC sub _set_ipc { $INST->set_ipc(@_) } @@ -280,6 +288,7 @@ return; }; +my $UUID_VIA = _add_uuid_via_ref(); my $CID = 1; sub context { # We need to grab these before anything else to ensure they are not @@ -357,13 +366,18 @@ # hit with how often this needs to be called. my $trace = bless( { - frame => [$pkg, $file, $line, $sub], - pid => $$, - tid => get_tid(), - cid => 'C' . $CID++, - hid => $hid, - nested => $hub->{nested}, + frame => [$pkg, $file, $line, $sub], + pid => $$, + tid => get_tid(), + cid => 'C' . $CID++, + hid => $hid, + nested => $hub->{nested}, buffered => $hub->{buffered}, + + $$UUID_VIA ? ( + huuid => $hub->{uuid}, + uuid => ${$UUID_VIA}->('context'), + ) : (), }, 'Test2::EventFacet::Trace' ); @@ -624,7 +638,7 @@ } } - $hub->finalize($trace->snapshot(hid => $hub->hid, nested => $hub->nested, buffered => $buffered), 1) + $hub->finalize($trace->snapshot(huuid => $hub->uuid, hid => $hub->hid, nested => $hub->nested, buffered => $buffered), 1) if $ok && !$hub->no_ending && !$hub->ended; @@ -632,11 +646,12 @@ my $pass = $ok && $hub->is_passing; my $e = $ctx->build_event( 'Subtest', - pass => $pass, - name => $name, - subtest_id => $hub->id, - buffered => $buffered, - subevents => \@events, + pass => $pass, + name => $name, + subtest_id => $hub->id, + subtest_uuid => $hub->uuid, + buffered => $buffered, + subevents => \@events, ); my $plan_ok = $hub->check_plan; @@ -1369,6 +1384,22 @@ Returns all the pre-subtest callback references. +=item test2_add_uuid_via(sub { ... }) + +=item $sub = test2_add_uuid_via() + +This allows you to provide a UUID generator. If provided UUIDs will be attached +to all events, hubs, and contexts. This is useful for storing, tracking, and +linking these objects. + +The sub you provide should always return a unique identifier. Most things will +expect a proper UUID string, however nothing in Test2::API enforces this. + +The sub will receive exactly 1 argument, the type of thing being tagged +'context', 'hub', or 'event'. In the future additional things may be tagged, in +which case new strings will be passed in. These are purely informative, you can +(and usually should) ignore them. + =back =head2 IPC AND CONCURRENCY diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Bail.pm new/Test-Simple-1.302128/lib/Test2/Event/Bail.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Bail.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Bail.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Diag.pm new/Test-Simple-1.302128/lib/Test2/Event/Diag.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Diag.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Diag.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Encoding.pm new/Test-Simple-1.302128/lib/Test2/Event/Encoding.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Encoding.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Encoding.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/croak/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Exception.pm new/Test-Simple-1.302128/lib/Test2/Event/Exception.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Exception.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Exception.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Fail.pm new/Test-Simple-1.302128/lib/Test2/Event/Fail.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Fail.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Fail.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::EventFacet::Info; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Generic.pm new/Test-Simple-1.302128/lib/Test2/Event/Generic.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Generic.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Generic.pm 2018-03-05 18:26:54.000000000 +0100 @@ -5,7 +5,7 @@ use Carp qw/croak/; use Scalar::Util qw/reftype/; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } use Test2::Util::HashBase; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Note.pm new/Test-Simple-1.302128/lib/Test2/Event/Note.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Note.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Note.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Ok.pm new/Test-Simple-1.302128/lib/Test2/Event/Ok.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Ok.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Ok.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Pass.pm new/Test-Simple-1.302128/lib/Test2/Event/Pass.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Pass.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Pass.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::EventFacet::Info; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Plan.pm new/Test-Simple-1.302128/lib/Test2/Event/Plan.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Plan.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Plan.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Skip.pm new/Test-Simple-1.302128/lib/Test2/Event/Skip.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Skip.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Skip.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Subtest.pm new/Test-Simple-1.302128/lib/Test2/Event/Subtest.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Subtest.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Subtest.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,10 +2,10 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) } -use Test2::Util::HashBase qw{subevents buffered subtest_id}; +use Test2::Util::HashBase qw{subevents buffered subtest_id subtest_uuid}; sub init { my $self = shift; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/TAP/Version.pm new/Test-Simple-1.302128/lib/Test2/Event/TAP/Version.pm --- old/Test-Simple-1.302125/lib/Test2/Event/TAP/Version.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/TAP/Version.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/croak/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event/Waiting.pm new/Test-Simple-1.302128/lib/Test2/Event/Waiting.pm --- old/Test-Simple-1.302125/lib/Test2/Event/Waiting.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event/Waiting.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Event.pm new/Test-Simple-1.302128/lib/Test2/Event.pm --- old/Test-Simple-1.302125/lib/Test2/Event.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Event.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,9 +2,9 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; -use Test2::Util::HashBase qw/trace -amnesty/; +use Test2::Util::HashBase qw/trace -amnesty uuid/; use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/; use Test2::Util qw(pkg_to_file); @@ -107,6 +107,10 @@ $out->{about}->{details} = $self->summary || undef; $out->{about}->{no_display} = $self->no_display || undef; + if (my $uuid = $self->uuid) { + $out->{about}->{uuid} = $uuid; + } + # Might be undef, we want to preserve that my $terminate = $self->terminate; $out->{control} = { @@ -303,6 +307,12 @@ B<Note:> This is how 'TODO' is implemented under the hood. TODO is essentially amnesty with the 'TODO' tag. The details are the reason for the TODO. +=item my $uuid = $e->uuid + +If UUID tagging is enabled (See L<Test::API>) then any event that has made its +way through a hub will be tagged with a UUID. A newly created event will not +yet be tagged in most cases. + =back =head2 NEW API diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/About.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/About.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/About.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/About.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,10 +2,10 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } -use Test2::Util::HashBase qw{ -package -no_display }; +use Test2::Util::HashBase qw{ -package -no_display -uuid }; 1; @@ -45,6 +45,12 @@ True if the event should be skipped by formatters. +=item $uuid = $about->{uuid} + +=item $uuid = $about->uuid() + +Will be set to a uuid if uuid tagging was enabled. + =back =head1 SOURCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Amnesty.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Amnesty.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Amnesty.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Amnesty.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; sub is_list { 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Assert.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Assert.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Assert.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Assert.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } use Test2::Util::HashBase qw{ -pass -no_debug -number }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Control.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Control.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Control.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Control.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } use Test2::Util::HashBase qw{ -global -terminate -halt -has_callback -encoding }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Error.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Error.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Error.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Error.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; sub facet_key { 'errors' } sub is_list { 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Info.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Info.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Info.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Info.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; sub is_list { 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Meta.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Meta.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Meta.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Meta.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } use vars qw/$AUTOLOAD/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Parent.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Parent.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Parent.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Parent.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/confess/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Plan.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Plan.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Plan.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Plan.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } use Test2::Util::HashBase qw{ -count -skip -none }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Render.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Render.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Render.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Render.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; sub is_list { 1 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet/Trace.pm new/Test-Simple-1.302128/lib/Test2/EventFacet/Trace.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet/Trace.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet/Trace.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,14 +2,14 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } use Test2::Util qw/get_tid pkg_to_file/; use Carp qw/confess/; -use Test2::Util::HashBase qw{^frame ^pid ^tid ^cid -hid -nested details -buffered}; +use Test2::Util::HashBase qw{^frame ^pid ^tid ^cid -hid -nested details -buffered -uuid -huuid}; { no warnings 'once'; @@ -36,6 +36,8 @@ sub signature { my $self = shift; + return $self->{+UUID} if $self->{+UUID}; + # Signature is only valid if all of these fields are defined, there is no # signature if any is missing. '0' is ok, but '' is not. return join ':' => map { (defined($_) && length($_)) ? $_ : return undef } ( @@ -134,12 +136,26 @@ The ID of the context that was used to create the event. +=item $uuid = $trace->{uuid} + +=item $uuid = $trace->uuid() + +The UUID of the context that was used to create the event. (If uuid tagging was +enabled) + =item $hid = $trace->{hid} =item $hid = $trace->hid() The ID of the hub that was current when the event was created. +=item $huuid = $trace->{huuid} + +=item $huuid = $trace->huuid() + +The UUID of the hub that was current when the event was created. (If uuid +tagging was enabled). + =item $int = $trace->{nested} =item $int = $trace->nested() @@ -210,9 +226,11 @@ =item $sig = trace->signature Get a signature string that identifies this trace. This is used to check if -multiple events are related. The Trace includes pid, tid, file, line number, -and the cid which is C<'C\d+'> for traces created by a context, or C<'T\d+'> -for traces created by C<new()>. +multiple events are related. + +If UUID's are enabled then a uuid is returned. Otherwise the signature includes +pid, tid, file, line number, and the cid which is C<'C\d+'> for traces created +by a context, or C<'T\d+'> for traces created by C<new()>. =back diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/EventFacet.pm new/Test-Simple-1.302128/lib/Test2/EventFacet.pm --- old/Test-Simple-1.302125/lib/Test2/EventFacet.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/EventFacet.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::Util::HashBase qw/-details/; use Carp qw/croak/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Formatter/TAP.pm new/Test-Simple-1.302128/lib/Test2/Formatter/TAP.pm --- old/Test-Simple-1.302125/lib/Test2/Formatter/TAP.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Formatter/TAP.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::Util qw/clone_io/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Formatter.pm new/Test-Simple-1.302128/lib/Test2/Formatter.pm --- old/Test-Simple-1.302125/lib/Test2/Formatter.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Formatter.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; my %ADDED; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Hub/Interceptor/Terminator.pm new/Test-Simple-1.302128/lib/Test2/Hub/Interceptor/Terminator.pm --- old/Test-Simple-1.302125/lib/Test2/Hub/Interceptor/Terminator.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Hub/Interceptor/Terminator.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Hub/Interceptor.pm new/Test-Simple-1.302128/lib/Test2/Hub/Interceptor.pm --- old/Test-Simple-1.302125/lib/Test2/Hub/Interceptor.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Hub/Interceptor.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::Hub::Interceptor::Terminator(); @@ -12,7 +12,7 @@ sub init { my $self = shift; - $self->SUPER::init; + $self->SUPER::init(); $self->{+NESTED} = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Hub/Subtest.pm new/Test-Simple-1.302128/lib/Test2/Hub/Subtest.pm --- old/Test-Simple-1.302125/lib/Test2/Hub/Subtest.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Hub/Subtest.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) } use Test2::Util::HashBase qw/nested exit_code manual_skip_all/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Hub.pm new/Test-Simple-1.302128/lib/Test2/Hub.pm --- old/Test-Simple-1.302125/lib/Test2/Hub.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Hub.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/carp croak confess/; @@ -25,6 +25,7 @@ _context_init _context_release + uuid active count failed @@ -35,6 +36,8 @@ skip_reason }; +my $UUID_VIA; + my $ID_POSTFIX = 1; sub init { my $self = shift; @@ -43,6 +46,9 @@ $self->{+TID} = get_tid(); $self->{+HID} = join ipc_separator, $self->{+PID}, $self->{+TID}, $ID_POSTFIX++; + $UUID_VIA ||= Test2::API::_add_uuid_via_ref(); + $self->{+UUID} = ${$UUID_VIA}->('hub') if $$UUID_VIA; + $self->{+NESTED} = 0 unless defined $self->{+NESTED}; $self->{+BUFFERED} = 0 unless defined $self->{+BUFFERED}; @@ -303,6 +309,8 @@ } } + $e->set_uuid(${$UUID_VIA}->('event')) if $$UUID_VIA; + # Optimize the most common case my $type = ref($e); if ($type eq 'Test2::Event::Pass' || ($type eq 'Test2::Event::Ok' && $e->{pass})) { @@ -775,6 +783,10 @@ Get the identifier string of the hub. +=item $uuid = $hub->uuid() + +If UUID tagging is enabled (see L<Test2::API>) then the hub will have a UUID. + =item $ipc = $hub->ipc() Get the IPC object used by the hub. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/IPC/Driver/Files.pm new/Test-Simple-1.302128/lib/Test2/IPC/Driver/Files.pm --- old/Test-Simple-1.302125/lib/Test2/IPC/Driver/Files.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/IPC/Driver/Files.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/IPC/Driver.pm new/Test-Simple-1.302128/lib/Test2/IPC/Driver.pm --- old/Test-Simple-1.302125/lib/Test2/IPC/Driver.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/IPC/Driver.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/confess/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/IPC.pm new/Test-Simple-1.302128/lib/Test2/IPC.pm --- old/Test-Simple-1.302125/lib/Test2/IPC.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/IPC.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Test2::API::Instance; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Tools/Tiny.pm new/Test-Simple-1.302128/lib/Test2/Tools/Tiny.pm --- old/Test-Simple-1.302125/lib/Test2/Tools/Tiny.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Tools/Tiny.pm 2018-03-05 18:26:54.000000000 +0100 @@ -16,7 +16,7 @@ use Test2::Hub::Interceptor(); use Test2::Hub::Interceptor::Terminator(); -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; BEGIN { require Exporter; our @ISA = qw(Exporter) } our @EXPORT = qw{ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Util/ExternalMeta.pm new/Test-Simple-1.302128/lib/Test2/Util/ExternalMeta.pm --- old/Test-Simple-1.302125/lib/Test2/Util/ExternalMeta.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Util/ExternalMeta.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/croak/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Util/Facets2Legacy.pm new/Test-Simple-1.302128/lib/Test2/Util/Facets2Legacy.pm --- old/Test-Simple-1.302125/lib/Test2/Util/Facets2Legacy.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Util/Facets2Legacy.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use Carp qw/croak confess/; use Scalar::Util qw/blessed/; @@ -111,4 +111,20 @@ return $facet_data->{control}->{terminate}; } +sub uuid { + my $in = shift; + + my $facet_data = _get_facet_data($in); + return $facet_data->{about}->{uuid} if $facet_data->{about} && $facet_data->{about}->{uuid}; + + if (blessed($in) && $in->isa('Test2::Event')) { + my $meth = $in->can('uuid'); + $meth = $in->can('SUPER::uuid') if $meth == \&uuid; + my $uuid = $in->$meth if $meth && $meth != \&uuid; + return $uuid if $uuid; + } + + return undef; +} + 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Util/HashBase.pm new/Test-Simple-1.302128/lib/Test2/Util/HashBase.pm --- old/Test-Simple-1.302125/lib/Test2/Util/HashBase.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Util/HashBase.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; ################################################################# # # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Util/Trace.pm new/Test-Simple-1.302128/lib/Test2/Util/Trace.pm --- old/Test-Simple-1.302125/lib/Test2/Util/Trace.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Util/Trace.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ require Test2::EventFacet::Trace; @ISA = ('Test2::EventFacet::Trace'); -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2/Util.pm new/Test-Simple-1.302128/lib/Test2/Util.pm --- old/Test-Simple-1.302125/lib/Test2/Util.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2/Util.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use POSIX(); use Config qw/%Config/; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/Test2.pm new/Test-Simple-1.302128/lib/Test2.pm --- old/Test-Simple-1.302125/lib/Test2.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/Test2.pm 2018-03-05 18:26:54.000000000 +0100 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/lib/ok.pm new/Test-Simple-1.302128/lib/ok.pm --- old/Test-Simple-1.302125/lib/ok.pm 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/lib/ok.pm 2018-03-05 18:26:54.000000000 +0100 @@ -1,5 +1,5 @@ package ok; -our $VERSION = '1.302125'; +our $VERSION = '1.302128'; use strict; use Test::More (); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/t/Test2/behavior/uuid.t new/Test-Simple-1.302128/t/Test2/behavior/uuid.t --- old/Test-Simple-1.302125/t/Test2/behavior/uuid.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Simple-1.302128/t/Test2/behavior/uuid.t 2018-03-05 18:26:54.000000000 +0100 @@ -0,0 +1,76 @@ +use Test2::Tools::Tiny; +use Test2::API qw/test2_add_uuid_via context intercept/; + +my %CNT; +test2_add_uuid_via(sub { + my $type = shift; + $CNT{$type} ||= 1; + $type . '-' . $CNT{$type}++; +}); + +my $events = intercept { + ok(1, "pass"); + + sub { + my $ctx = context(); + ok(1, "pass"); + ok(0, "fail"); + $ctx->release; + }->(); + + tests foo => sub { + ok(1, "pass"); + }; + + warnings { + require Test::More; + *subtest = \&Test::More::subtest; + }; + + subtest(foo => sub { + ok(1, "pass"); + }); +}; + +my $hub = Test2::API::test2_stack->top; +is($hub->uuid, 'hub-1', "First hub got a uuid"); + +is($events->[0]->uuid, 'event-1', "First event gets first uuid"); +is($events->[0]->trace->uuid, 'context-2', "First event has correct context"); +is($events->[0]->trace->huuid, 'hub-2', "First event has correct hub"); + +is($events->[1]->uuid, 'event-2', "Second event gets correct uuid"); +is($events->[1]->trace->uuid, 'context-3', "Second event has correct context"); +is($events->[1]->trace->huuid, 'hub-2', "Second event has correct hub"); + +is($events->[2]->uuid, 'event-3', "Third event gets correct uuid"); +is($events->[2]->trace->uuid, $events->[1]->trace->uuid, "Third event shares context with event 2"); +is($events->[2]->trace->huuid, 'hub-2', "Third event has correct hub"); + +is($events->[3]->uuid, 'event-6', "subtest event gets correct uuid (not next)"); +is($events->[3]->subtest_uuid, 'hub-3', "subtest event gets correct subtest-uuid (next hub uuid)"); +is($events->[3]->trace->uuid, 'context-4', "subtest gets next sequential context"); +is($events->[3]->trace->huuid, 'hub-2', "subtest event has correct hub"); + +is($events->[3]->subevents->[0]->uuid, 'event-4', "First subevent gets next event uuid"); +is($events->[3]->subevents->[0]->trace->uuid, 'context-5', "First subevent has correct context"); +is($events->[3]->subevents->[0]->trace->huuid, 'hub-3', "First subevent has correct hub uuid (subtest hub uuid)"); + +is($events->[3]->subevents->[1]->uuid, 'event-5', "Second subevent gets next event uuid"); +is($events->[3]->subevents->[1]->trace->uuid, $events->[3]->trace->uuid, "Second subevent has same context as subtest itself"); +is($events->[3]->subevents->[1]->trace->huuid, 'hub-3', "Second subevent has correct hub uuid (subtest hub uuid)"); + +is($events->[5]->uuid, 'event-10', "subtest event gets correct uuid (not next)"); +is($events->[5]->subtest_uuid, 'hub-4', "subtest event gets correct subtest-uuid (next hub uuid)"); +is($events->[5]->trace->uuid, 'context-8', "subtest gets next sequential context"); +is($events->[5]->trace->huuid, 'hub-2', "subtest event has correct hub"); + +is($events->[5]->subevents->[0]->uuid, 'event-8', "First subevent gets next event uuid"); +is($events->[5]->subevents->[0]->trace->uuid, 'context-10', "First subevent has correct context"); +is($events->[5]->subevents->[0]->trace->huuid, 'hub-4', "First subevent has correct hub uuid (subtest hub uuid)"); + +is($events->[5]->subevents->[1]->uuid, 'event-9', "Second subevent gets next event uuid"); +is($events->[5]->subevents->[1]->trace->uuid, $events->[5]->trace->uuid, "Second subevent has same context as subtest itself"); +is($events->[5]->subevents->[1]->trace->huuid, 'hub-2', "Second subevent has correct hub uuid (subtest hub uuid)"); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Simple-1.302125/t/Test2/modules/API/Instance.t new/Test-Simple-1.302128/t/Test2/modules/API/Instance.t --- old/Test-Simple-1.302125/t/Test2/modules/API/Instance.t 2018-02-22 08:10:41.000000000 +0100 +++ new/Test-Simple-1.302128/t/Test2/modules/API/Instance.t 2018-03-05 18:26:54.000000000 +0100 @@ -24,6 +24,8 @@ ipc => undef, formatter => undef, + add_uuid_via => undef, + ipc_polling => undef, ipc_drivers => [], ipc_timeout => 30, @@ -60,6 +62,8 @@ ipc_timeout => 30, ipc_disabled => 0, + add_uuid_via => undef, + formatters => [], finalized => undef,