In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9fe558dc18b541114538e75431e9b31368d744c5?hp=9dd1a77dda34b81dad2fc1260711f50c143f9fbe>
- Log ----------------------------------------------------------------- commit 9fe558dc18b541114538e75431e9b31368d744c5 Author: Steve Hay <[email protected]> Date: Tue Aug 9 08:34:16 2016 +0100 Upgrade Test-Simple from version 1.302045 to 1.302049 M MANIFEST M Porting/Maintainers.pl M cpan/Test-Simple/lib/Test/Builder.pm M cpan/Test-Simple/lib/Test/Builder/Formatter.pm M cpan/Test-Simple/lib/Test/Builder/Module.pm M cpan/Test-Simple/lib/Test/Builder/Tester.pm M cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm M cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm M cpan/Test-Simple/lib/Test/More.pm M cpan/Test-Simple/lib/Test/Simple.pm M cpan/Test-Simple/lib/Test/Tester.pm M cpan/Test-Simple/lib/Test/Tester/Capture.pm M cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm M cpan/Test-Simple/lib/Test/Tester/Delegate.pm M cpan/Test-Simple/lib/Test/use/ok.pm M cpan/Test-Simple/lib/Test2.pm M cpan/Test-Simple/lib/Test2/API.pm M cpan/Test-Simple/lib/Test2/API/Breakage.pm M cpan/Test-Simple/lib/Test2/API/Context.pm M cpan/Test-Simple/lib/Test2/API/Instance.pm M cpan/Test-Simple/lib/Test2/API/Stack.pm M cpan/Test-Simple/lib/Test2/Event.pm M cpan/Test-Simple/lib/Test2/Event/Bail.pm M cpan/Test-Simple/lib/Test2/Event/Diag.pm M cpan/Test-Simple/lib/Test2/Event/Exception.pm M cpan/Test-Simple/lib/Test2/Event/Generic.pm M cpan/Test-Simple/lib/Test2/Event/Info.pm M cpan/Test-Simple/lib/Test2/Event/Note.pm M cpan/Test-Simple/lib/Test2/Event/Ok.pm M cpan/Test-Simple/lib/Test2/Event/Plan.pm M cpan/Test-Simple/lib/Test2/Event/Skip.pm M cpan/Test-Simple/lib/Test2/Event/Subtest.pm M cpan/Test-Simple/lib/Test2/Event/Waiting.pm M cpan/Test-Simple/lib/Test2/Formatter.pm M cpan/Test-Simple/lib/Test2/Formatter/TAP.pm M cpan/Test-Simple/lib/Test2/Hub.pm M cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm M cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm M cpan/Test-Simple/lib/Test2/Hub/Subtest.pm M cpan/Test-Simple/lib/Test2/IPC.pm M cpan/Test-Simple/lib/Test2/IPC/Driver.pm M cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm M cpan/Test-Simple/lib/Test2/Util.pm M cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm M cpan/Test-Simple/lib/Test2/Util/HashBase.pm M cpan/Test-Simple/lib/Test2/Util/Trace.pm M cpan/Test-Simple/lib/ok.pm A cpan/Test-Simple/t/regression/694_note_diag_return_values.t commit 89309dcee30820578343533ad7e8beb3e25e18b9 Author: Steve Hay <[email protected]> Date: Tue Aug 9 08:29:33 2016 +0100 Upgrade IO-Socket-IP from version 0.37 to 0.38 M Porting/Maintainers.pl M cpan/IO-Socket-IP/lib/IO/Socket/IP.pm M cpan/IO-Socket-IP/t/11sockopts.t ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 + Porting/Maintainers.pl | 4 +- cpan/IO-Socket-IP/lib/IO/Socket/IP.pm | 46 +++++++++++++++++++--- cpan/IO-Socket-IP/t/11sockopts.t | 11 ++++++ cpan/Test-Simple/lib/Test/Builder.pm | 4 +- cpan/Test-Simple/lib/Test/Builder/Formatter.pm | 2 +- cpan/Test-Simple/lib/Test/Builder/Module.pm | 2 +- cpan/Test-Simple/lib/Test/Builder/Tester.pm | 2 +- cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm | 2 +- cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm | 2 +- cpan/Test-Simple/lib/Test/More.pm | 2 +- cpan/Test-Simple/lib/Test/Simple.pm | 2 +- cpan/Test-Simple/lib/Test/Tester.pm | 2 +- cpan/Test-Simple/lib/Test/Tester/Capture.pm | 2 +- cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm | 2 +- cpan/Test-Simple/lib/Test/Tester/Delegate.pm | 2 +- cpan/Test-Simple/lib/Test/use/ok.pm | 2 +- cpan/Test-Simple/lib/Test2.pm | 2 +- cpan/Test-Simple/lib/Test2/API.pm | 2 +- cpan/Test-Simple/lib/Test2/API/Breakage.pm | 2 +- cpan/Test-Simple/lib/Test2/API/Context.pm | 4 +- cpan/Test-Simple/lib/Test2/API/Instance.pm | 2 +- cpan/Test-Simple/lib/Test2/API/Stack.pm | 2 +- cpan/Test-Simple/lib/Test2/Event.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Bail.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Diag.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Exception.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Generic.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Info.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Note.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Ok.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Plan.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Skip.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Subtest.pm | 2 +- cpan/Test-Simple/lib/Test2/Event/Waiting.pm | 2 +- cpan/Test-Simple/lib/Test2/Formatter.pm | 2 +- cpan/Test-Simple/lib/Test2/Formatter/TAP.pm | 2 +- cpan/Test-Simple/lib/Test2/Hub.pm | 15 ++++++- cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm | 2 +- .../lib/Test2/Hub/Interceptor/Terminator.pm | 2 +- cpan/Test-Simple/lib/Test2/Hub/Subtest.pm | 2 +- cpan/Test-Simple/lib/Test2/IPC.pm | 2 +- cpan/Test-Simple/lib/Test2/IPC/Driver.pm | 2 +- cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm | 2 +- cpan/Test-Simple/lib/Test2/Util.pm | 2 +- cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm | 2 +- cpan/Test-Simple/lib/Test2/Util/HashBase.pm | 2 +- cpan/Test-Simple/lib/Test2/Util/Trace.pm | 2 +- cpan/Test-Simple/lib/ok.pm | 2 +- .../t/regression/694_note_diag_return_values.t | 20 ++++++++++ 50 files changed, 135 insertions(+), 54 deletions(-) create mode 100644 cpan/Test-Simple/t/regression/694_note_diag_return_values.t diff --git a/MANIFEST b/MANIFEST index 4cec28b..537796d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2724,6 +2724,7 @@ cpan/Test-Simple/t/lib/TieOut.pm cpan/Test-Simple/t/regression/642_persistent_end.t cpan/Test-Simple/t/regression/662-tbt-no-plan.t cpan/Test-Simple/t/regression/684-nested_todo_diag.t +cpan/Test-Simple/t/regression/694_note_diag_return_values.t cpan/Test-Simple/t/regression/no_name_in_subtest.t cpan/Test-Simple/t/Test2/acceptance/try_it_done_testing.t cpan/Test-Simple/t/Test2/acceptance/try_it_fork.t diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index a4c1987..d426338 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -696,7 +696,7 @@ use File::Glob qw(:case); }, 'IO::Socket::IP' => { - 'DISTRIBUTION' => 'PEVANS/IO-Socket-IP-0.37.tar.gz', + 'DISTRIBUTION' => 'PEVANS/IO-Socket-IP-0.38.tar.gz', 'FILES' => q[cpan/IO-Socket-IP], 'EXCLUDED' => [ qr{^examples/}, @@ -1193,7 +1193,7 @@ use File::Glob qw(:case); }, 'Test::Simple' => { - 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302045.tar.gz', + 'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302049.tar.gz', 'FILES' => q[cpan/Test-Simple], 'EXCLUDED' => [ qr{^examples/}, diff --git a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm index 3266fab..1bf6b0e 100644 --- a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm +++ b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm @@ -7,7 +7,7 @@ package IO::Socket::IP; # $VERSION needs to be set before use base 'IO::Socket' # - https://rt.cpan.org/Ticket/Display.html?id=92107 BEGIN { - $VERSION = '0.37'; + $VERSION = '0.38'; } use strict; @@ -265,6 +265,22 @@ If true, set the C<SO_REUSEPORT> sockopt (not all OSes implement this sockopt) If true, set the C<SO_BROADCAST> sockopt +=item Sockopts => ARRAY + +An optional array of other socket options to apply after the three listed +above. The value is an ARRAY containing 2- or 3-element ARRAYrefs. Each inner +array relates to a single option, giving the level and option name, and an +optional value. If the value element is missing, it will be given the value of +a platform-sized integer 1 constant (i.e. suitable to enable most of the +common boolean options). + +For example, both options given below are equivalent to setting C<ReuseAddr>. + + Sockopts => [ + [ SOL_SOCKET, SO_REUSEADDR ], + [ SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) ], + ] + =item V6Only => BOOL If defined, set the C<IPV6_V6ONLY> sockopt when creating C<PF_INET6> sockets @@ -504,10 +520,27 @@ sub _io_socket_ip__configure } } + my $INT_1 = pack "i", 1; + my @sockopts_enabled; - push @sockopts_enabled, SO_REUSEADDR if $arg->{ReuseAddr}; - push @sockopts_enabled, SO_REUSEPORT if $arg->{ReusePort}; - push @sockopts_enabled, SO_BROADCAST if $arg->{Broadcast}; + push @sockopts_enabled, [ SOL_SOCKET, SO_REUSEADDR, $INT_1 ] if $arg->{ReuseAddr}; + push @sockopts_enabled, [ SOL_SOCKET, SO_REUSEPORT, $INT_1 ] if $arg->{ReusePort}; + push @sockopts_enabled, [ SOL_SOCKET, SO_BROADCAST, $INT_1 ] if $arg->{Broadcast}; + + if( my $sockopts = $arg->{Sockopts} ) { + ref $sockopts eq "ARRAY" or croak "Expected 'Sockopts' to be an ARRAY ref"; + foreach ( @$sockopts ) { + ref $_ eq "ARRAY" or croak "Bad Sockopts item - expected ARRAYref"; + @$_ >= 2 and @$_ <= 3 or + croak "Bad Sockopts item - expected 2 or 3 elements"; + + my ( $level, $optname, $value ) = @$_; + # TODO: consider more sanity checking on argument values + + defined $value or $value = $INT_1; + push @sockopts_enabled, [ $level, $optname, $value ]; + } + } my $blocking = $arg->{Blocking}; defined $blocking or $blocking = 1; @@ -607,7 +640,8 @@ sub setup $self->blocking( 0 ) unless ${*$self}{io_socket_ip_blocking}; foreach my $sockopt ( @{ ${*$self}{io_socket_ip_sockopts} } ) { - $self->setsockopt( SOL_SOCKET, $sockopt, pack "i", 1 ) or ( $@ = "$!", return undef ); + my ( $level, $optname, $value ) = @$sockopt; + $self->setsockopt( $level, $optname, $value ) or ( $@ = "$!", return undef ); } if( defined ${*$self}{io_socket_ip_v6only} and defined $AF_INET6 and $info->{family} == $AF_INET6 ) { @@ -685,6 +719,7 @@ sub connect :method } elsif( not( $err == EINPROGRESS or $err == EWOULDBLOCK ) ) { # Failed for some other reason + $self->blocking( $was_blocking ); return undef; } elsif( !$was_blocking ) { @@ -694,6 +729,7 @@ sub connect :method my $vec = ''; vec( $vec, $self->fileno, 1 ) = 1; if( !select( undef, $vec, $vec, $timeout ) ) { + $self->blocking( $was_blocking ); $! = ETIMEDOUT; return undef; } diff --git a/cpan/IO-Socket-IP/t/11sockopts.t b/cpan/IO-Socket-IP/t/11sockopts.t index 90f92ae..5b85092 100644 --- a/cpan/IO-Socket-IP/t/11sockopts.t +++ b/cpan/IO-Socket-IP/t/11sockopts.t @@ -24,6 +24,17 @@ TODO: { ) or die "Cannot socket() - $@"; ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set' ); + + $sock = IO::Socket::IP->new( + LocalHost => "127.0.0.1", + Type => SOCK_STREAM, + Listen => 1, + Sockopts => [ + [ SOL_SOCKET, SO_REUSEADDR ], + ], + ) or die "Cannot socket() - $@"; + + ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set via Sockopts' ); } SKIP: { diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index 2a1be72..09e0f1e 100644 --- a/cpan/Test-Simple/lib/Test/Builder.pm +++ b/cpan/Test-Simple/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.006; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { if( $] < 5.008 ) { @@ -1183,6 +1183,7 @@ sub diag { my $ctx = $self->ctx; $ctx->diag(join '' => map {defined($_) ? $_ : 'undef'} @_); $ctx->release; + return 0; } @@ -1193,6 +1194,7 @@ sub note { my $ctx = $self->ctx; $ctx->note(join '' => map {defined($_) ? $_ : 'undef'} @_); $ctx->release; + return 0; } diff --git a/cpan/Test-Simple/lib/Test/Builder/Formatter.pm b/cpan/Test-Simple/lib/Test/Builder/Formatter.pm index 389597f..b4d7b9a 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Formatter.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Formatter.pm @@ -2,7 +2,7 @@ package Test::Builder::Formatter; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) } diff --git a/cpan/Test-Simple/lib/Test/Builder/Module.pm b/cpan/Test-Simple/lib/Test/Builder/Module.pm index a1434f5..511e5e4 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Module.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Module.pm @@ -7,7 +7,7 @@ use Test::Builder; require Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; =head1 NAME diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester.pm b/cpan/Test-Simple/lib/Test/Builder/Tester.pm index de5e5e6..cce4461 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Tester.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Tester.pm @@ -1,7 +1,7 @@ package Test::Builder::Tester; use strict; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test::Builder; use Symbol; diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm index c28e5ad6..228bded 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm @@ -1,7 +1,7 @@ package Test::Builder::Tester::Color; use strict; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; require Test::Builder::Tester; diff --git a/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm b/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm index b716af9..afeb6bf 100644 --- a/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm +++ b/cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm @@ -2,7 +2,7 @@ package Test::Builder::TodoDiag; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) } diff --git a/cpan/Test-Simple/lib/Test/More.pm b/cpan/Test-Simple/lib/Test/More.pm index 66208c4..e1e3db3 100644 --- a/cpan/Test-Simple/lib/Test/More.pm +++ b/cpan/Test-Simple/lib/Test/More.pm @@ -17,7 +17,7 @@ sub _carp { return warn @_, " at $file line $line\n"; } -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); diff --git a/cpan/Test-Simple/lib/Test/Simple.pm b/cpan/Test-Simple/lib/Test/Simple.pm index 273eee7..3f27580 100644 --- a/cpan/Test-Simple/lib/Test/Simple.pm +++ b/cpan/Test-Simple/lib/Test/Simple.pm @@ -4,7 +4,7 @@ use 5.006; use strict; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test::Builder::Module; our @ISA = qw(Test::Builder::Module); diff --git a/cpan/Test-Simple/lib/Test/Tester.pm b/cpan/Test-Simple/lib/Test/Tester.pm index adbaac9..4fd23bd 100644 --- a/cpan/Test-Simple/lib/Test/Tester.pm +++ b/cpan/Test-Simple/lib/Test/Tester.pm @@ -18,7 +18,7 @@ require Exporter; use vars qw( @ISA @EXPORT ); -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; @EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); @ISA = qw( Exporter ); diff --git a/cpan/Test-Simple/lib/Test/Tester/Capture.pm b/cpan/Test-Simple/lib/Test/Tester/Capture.pm index 5a440c7..cccbf3a 100644 --- a/cpan/Test-Simple/lib/Test/Tester/Capture.pm +++ b/cpan/Test-Simple/lib/Test/Tester/Capture.pm @@ -2,7 +2,7 @@ use strict; package Test::Tester::Capture; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test::Builder; diff --git a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm index 4c282bf..317830d 100644 --- a/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm +++ b/cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm @@ -3,7 +3,7 @@ use strict; package Test::Tester::CaptureRunner; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test::Tester::Capture; diff --git a/cpan/Test-Simple/lib/Test/Tester/Delegate.pm b/cpan/Test-Simple/lib/Test/Tester/Delegate.pm index d331496..6d988f1 100644 --- a/cpan/Test-Simple/lib/Test/Tester/Delegate.pm +++ b/cpan/Test-Simple/lib/Test/Tester/Delegate.pm @@ -3,7 +3,7 @@ use warnings; package Test::Tester::Delegate; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use vars '$AUTOLOAD'; diff --git a/cpan/Test-Simple/lib/Test/use/ok.pm b/cpan/Test-Simple/lib/Test/use/ok.pm index e1e4b98..684d908 100644 --- a/cpan/Test-Simple/lib/Test/use/ok.pm +++ b/cpan/Test-Simple/lib/Test/use/ok.pm @@ -1,7 +1,7 @@ package Test::use::ok; use 5.005; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; __END__ diff --git a/cpan/Test-Simple/lib/Test2.pm b/cpan/Test-Simple/lib/Test2.pm index c67ad19..9d7bb32 100644 --- a/cpan/Test-Simple/lib/Test2.pm +++ b/cpan/Test-Simple/lib/Test2.pm @@ -2,7 +2,7 @@ package Test2; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; 1; diff --git a/cpan/Test-Simple/lib/Test2/API.pm b/cpan/Test-Simple/lib/Test2/API.pm index 6f91667..418ad85 100644 --- a/cpan/Test-Simple/lib/Test2/API.pm +++ b/cpan/Test-Simple/lib/Test2/API.pm @@ -2,7 +2,7 @@ package Test2::API; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; my $INST; diff --git a/cpan/Test-Simple/lib/Test2/API/Breakage.pm b/cpan/Test-Simple/lib/Test2/API/Breakage.pm index 580e091..0fd4898 100644 --- a/cpan/Test-Simple/lib/Test2/API/Breakage.pm +++ b/cpan/Test-Simple/lib/Test2/API/Breakage.pm @@ -2,7 +2,7 @@ package Test2::API::Breakage; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Util qw/pkg_to_file/; diff --git a/cpan/Test-Simple/lib/Test2/API/Context.pm b/cpan/Test-Simple/lib/Test2/API/Context.pm index 6e9362f..d6de0e2 100644 --- a/cpan/Test-Simple/lib/Test2/API/Context.pm +++ b/cpan/Test-Simple/lib/Test2/API/Context.pm @@ -2,7 +2,7 @@ package Test2::API::Context; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Carp qw/confess croak longmess/; @@ -412,7 +412,7 @@ inherit it: =item you MUST always use the context() sub from Test2::API Creating your own context via C<< Test2::API::Context->new() >> will almost never -produce a desirable result. Use C<context()> which is exported by L<Test2>. +produce a desirable result. Use C<context()> which is exported by L<Test2::API>. There are a handful of cases where a tool author may want to create a new context by hand, which is why the C<new> method exists. Unless you really know diff --git a/cpan/Test-Simple/lib/Test2/API/Instance.pm b/cpan/Test-Simple/lib/Test2/API/Instance.pm index 7275e18..a24de44 100644 --- a/cpan/Test-Simple/lib/Test2/API/Instance.pm +++ b/cpan/Test-Simple/lib/Test2/API/Instance.pm @@ -2,7 +2,7 @@ package Test2::API::Instance; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/; diff --git a/cpan/Test-Simple/lib/Test2/API/Stack.pm b/cpan/Test-Simple/lib/Test2/API/Stack.pm index ec19553..766ce3d 100644 --- a/cpan/Test-Simple/lib/Test2/API/Stack.pm +++ b/cpan/Test-Simple/lib/Test2/API/Stack.pm @@ -2,7 +2,7 @@ package Test2::API::Stack; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Hub(); diff --git a/cpan/Test-Simple/lib/Test2/Event.pm b/cpan/Test-Simple/lib/Test2/Event.pm index 83365b5..0da8163 100644 --- a/cpan/Test-Simple/lib/Test2/Event.pm +++ b/cpan/Test-Simple/lib/Test2/Event.pm @@ -2,7 +2,7 @@ package Test2::Event; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Util::HashBase qw/trace nested in_subtest subtest_id/; diff --git a/cpan/Test-Simple/lib/Test2/Event/Bail.pm b/cpan/Test-Simple/lib/Test2/Event/Bail.pm index 44688b3..d52524a 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Bail.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Bail.pm @@ -2,7 +2,7 @@ package Test2::Event::Bail; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Diag.pm b/cpan/Test-Simple/lib/Test2/Event/Diag.pm index afb4d6f..c5a123e 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Diag.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Diag.pm @@ -2,7 +2,7 @@ package Test2::Event::Diag; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Exception.pm b/cpan/Test-Simple/lib/Test2/Event/Exception.pm index 5e914fc..7e07579 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Exception.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Exception.pm @@ -2,7 +2,7 @@ package Test2::Event::Exception; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Generic.pm b/cpan/Test-Simple/lib/Test2/Event/Generic.pm index 4a7d332..8d22712 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Generic.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Generic.pm @@ -5,7 +5,7 @@ use warnings; use Carp qw/croak/; use Scalar::Util qw/reftype/; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } use Test2::Util::HashBase; diff --git a/cpan/Test-Simple/lib/Test2/Event/Info.pm b/cpan/Test-Simple/lib/Test2/Event/Info.pm index 029ab54..ba4a289 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Info.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Info.pm @@ -4,7 +4,7 @@ use warnings; use Scalar::Util qw/blessed/; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } use Test2::Util::HashBase qw/diagnostics renderer/; diff --git a/cpan/Test-Simple/lib/Test2/Event/Note.pm b/cpan/Test-Simple/lib/Test2/Event/Note.pm index c277296..71ed4ee 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Note.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Note.pm @@ -2,7 +2,7 @@ package Test2::Event::Note; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Ok.pm b/cpan/Test-Simple/lib/Test2/Event/Ok.pm index 341dc06..cf9190d 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Ok.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Ok.pm @@ -2,7 +2,7 @@ package Test2::Event::Ok; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Plan.pm b/cpan/Test-Simple/lib/Test2/Event/Plan.pm index 904f6e9..841360c 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Plan.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Plan.pm @@ -2,7 +2,7 @@ package Test2::Event::Plan; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Skip.pm b/cpan/Test-Simple/lib/Test2/Event/Skip.pm index 9b7aa64..2184d5b 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Skip.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Skip.pm @@ -2,7 +2,7 @@ package Test2::Event::Skip; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Subtest.pm b/cpan/Test-Simple/lib/Test2/Event/Subtest.pm index 45ba0f5..e56fd47 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Subtest.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Subtest.pm @@ -2,7 +2,7 @@ package Test2::Event::Subtest; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) } diff --git a/cpan/Test-Simple/lib/Test2/Event/Waiting.pm b/cpan/Test-Simple/lib/Test2/Event/Waiting.pm index 15db583..db97e5d 100644 --- a/cpan/Test-Simple/lib/Test2/Event/Waiting.pm +++ b/cpan/Test-Simple/lib/Test2/Event/Waiting.pm @@ -2,7 +2,7 @@ package Test2::Event::Waiting; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } diff --git a/cpan/Test-Simple/lib/Test2/Formatter.pm b/cpan/Test-Simple/lib/Test2/Formatter.pm index 77d023d..bf019cb 100644 --- a/cpan/Test-Simple/lib/Test2/Formatter.pm +++ b/cpan/Test-Simple/lib/Test2/Formatter.pm @@ -2,7 +2,7 @@ package Test2::Formatter; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; my %ADDED; diff --git a/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm b/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm index 09211f0..3500484 100644 --- a/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm +++ b/cpan/Test-Simple/lib/Test2/Formatter/TAP.pm @@ -3,7 +3,7 @@ use strict; use warnings; require PerlIO; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Util::HashBase qw{ diff --git a/cpan/Test-Simple/lib/Test2/Hub.pm b/cpan/Test-Simple/lib/Test2/Hub.pm index 707c585..dd28af4 100644 --- a/cpan/Test-Simple/lib/Test2/Hub.pm +++ b/cpan/Test-Simple/lib/Test2/Hub.pm @@ -2,7 +2,7 @@ package Test2::Hub; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Carp qw/carp croak confess/; @@ -23,6 +23,7 @@ use Test2::Util::HashBase qw{ _context_init _context_release + active count failed ended @@ -329,9 +330,10 @@ sub finalize { my $plan = $self->{+_PLAN}; my $count = $self->{+COUNT}; my $failed = $self->{+FAILED}; + my $active = $self->{+ACTIVE}; # return if NOTHING was done. - return unless $do_plan || defined($plan) || $count || $failed; + return unless $active || $do_plan || defined($plan) || $count || $failed; unless ($self->{+ENDED}) { if ($self->{+_FOLLOW_UPS}) { @@ -719,6 +721,15 @@ This can be used to disable auto-ending behavior for a hub. The auto-ending behavior is triggered by an end block and is used to cull IPC events, and output the final plan if the plan was 'no_plan'. +=item $bool = $hub->active + +=item $hub->set_active($bool) + +These are used to get/set the 'active' attribute. When true this attribute will +force C<< hub->finalize() >> to take action even if there is no plan, and no +tests have been run. This flag is useful for plugins that add follow-up +behaviors that need to run even if no events are seen. + =back =head2 STATE METHODS diff --git a/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm b/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm index f81284d..5eb9501 100644 --- a/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm +++ b/cpan/Test-Simple/lib/Test2/Hub/Interceptor.pm @@ -2,7 +2,7 @@ package Test2::Hub::Interceptor; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Hub::Interceptor::Terminator(); diff --git a/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm b/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm index 1666274..3394072 100644 --- a/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm +++ b/cpan/Test-Simple/lib/Test2/Hub/Interceptor/Terminator.pm @@ -2,7 +2,7 @@ package Test2::Hub::Interceptor::Terminator; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; 1; diff --git a/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm b/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm index 835090a..e44f15d 100644 --- a/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm +++ b/cpan/Test-Simple/lib/Test2/Hub/Subtest.pm @@ -2,7 +2,7 @@ package Test2::Hub::Subtest; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::Hub; our @ISA = qw(Test2::Hub) } diff --git a/cpan/Test-Simple/lib/Test2/IPC.pm b/cpan/Test-Simple/lib/Test2/IPC.pm index c09293a..96e5b16 100644 --- a/cpan/Test-Simple/lib/Test2/IPC.pm +++ b/cpan/Test-Simple/lib/Test2/IPC.pm @@ -2,7 +2,7 @@ package Test2::IPC; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::API::Instance; diff --git a/cpan/Test-Simple/lib/Test2/IPC/Driver.pm b/cpan/Test-Simple/lib/Test2/IPC/Driver.pm index 521e4ce..cf765ee 100644 --- a/cpan/Test-Simple/lib/Test2/IPC/Driver.pm +++ b/cpan/Test-Simple/lib/Test2/IPC/Driver.pm @@ -2,7 +2,7 @@ package Test2::IPC::Driver; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Carp qw/confess longmess/; diff --git a/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm b/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm index 7cf62c8..9ace1c4 100644 --- a/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm +++ b/cpan/Test-Simple/lib/Test2/IPC/Driver/Files.pm @@ -2,7 +2,7 @@ package Test2::IPC::Driver::Files; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) } diff --git a/cpan/Test-Simple/lib/Test2/Util.pm b/cpan/Test-Simple/lib/Test2/Util.pm index c44a752..c730c04 100644 --- a/cpan/Test-Simple/lib/Test2/Util.pm +++ b/cpan/Test-Simple/lib/Test2/Util.pm @@ -2,7 +2,7 @@ package Test2::Util; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Config qw/%Config/; diff --git a/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm b/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm index e7555e3..221544e 100644 --- a/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm +++ b/cpan/Test-Simple/lib/Test2/Util/ExternalMeta.pm @@ -2,7 +2,7 @@ package Test2::Util::ExternalMeta; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Carp qw/croak/; diff --git a/cpan/Test-Simple/lib/Test2/Util/HashBase.pm b/cpan/Test-Simple/lib/Test2/Util/HashBase.pm index 1121385..aa95c02 100644 --- a/cpan/Test-Simple/lib/Test2/Util/HashBase.pm +++ b/cpan/Test-Simple/lib/Test2/Util/HashBase.pm @@ -2,7 +2,7 @@ package Test2::Util::HashBase; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; require Carp; diff --git a/cpan/Test-Simple/lib/Test2/Util/Trace.pm b/cpan/Test-Simple/lib/Test2/Util/Trace.pm index 0dc99fe..5e13d65 100644 --- a/cpan/Test-Simple/lib/Test2/Util/Trace.pm +++ b/cpan/Test-Simple/lib/Test2/Util/Trace.pm @@ -2,7 +2,7 @@ package Test2::Util::Trace; use strict; use warnings; -our $VERSION = '1.302045'; +our $VERSION = '1.302049'; use Test2::Util qw/get_tid/; diff --git a/cpan/Test-Simple/lib/ok.pm b/cpan/Test-Simple/lib/ok.pm index 5f3dd1c..b0d3441 100644 --- a/cpan/Test-Simple/lib/ok.pm +++ b/cpan/Test-Simple/lib/ok.pm @@ -1,5 +1,5 @@ package ok; -$ok::VERSION = '1.302045'; +$ok::VERSION = '1.302049'; use strict; use Test::More (); diff --git a/cpan/Test-Simple/t/regression/694_note_diag_return_values.t b/cpan/Test-Simple/t/regression/694_note_diag_return_values.t new file mode 100644 index 0000000..0c72a6f --- /dev/null +++ b/cpan/Test-Simple/t/regression/694_note_diag_return_values.t @@ -0,0 +1,20 @@ +use Test::More; +use strict; +use warnings; + +use Test2::API qw/intercept/; + +my @returns; +intercept { + push @returns => diag('foo'); + push @returns => note('foo'); + + my $tb = Test::Builder->new; + push @returns => $tb->diag('foo'); + push @returns => $tb->note('foo'); +}; + +is(@returns, 4, "4 return values"); +is_deeply(\@returns, [0, 0, 0, 0], "All note/diag returns are 0"); + +done_testing; -- Perl5 Master Repository
