Skip to content

Commit

Permalink
Update Test-Simple to CPAN version 1.302067
Browse files Browse the repository at this point in the history
  [DELTA]

1.302067  2016-11-23 07:37:56-08:00 America/Los_Angeles

    - Fix context test for recent blead.

1.302066  2016-11-08 07:58:39-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Handle cases where SysV IPC can be available but not enabled
    - Import 'context' into Test2::IPC, it is used by 'cull'
    - Propogate warnings settings to use_ok (#736)

1.302065  2016-10-30 11:54:37-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Set the TEST_ACTIVE env var to true
    - Set the TEST2_ACTIVE env var to true
    - Fix the oldest bug still in the bug list (#6)
      This fixes cmp_ok output is some confusing cases
    - Update travis config
    - Add missing author deps
    - Fix handling of negative pid's on windows
    - Add can() to Test::Tester::Delegate (despite deprecation)
    - Fix some minor test issues

1.302064  2016-10-24 21:03:24-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Repo management improvements
    - Better handling of info vs diag in ->send_event
    - Fix test that used 'parent'
    - Better handling of non-bumping failures (#728)

1.302063  2016-10-23 21:31:20-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix double release when 'throw' is used in context_do()
  • Loading branch information
bingos authored and khwilliamson committed Jan 12, 2017
1 parent 440f3ee commit d45cc9a
Show file tree
Hide file tree
Showing 55 changed files with 263 additions and 115 deletions.
3 changes: 3 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,8 @@ cpan/Test-Simple/t/Legacy/plan_shouldnt_import.t
cpan/Test-Simple/t/Legacy/plan_skip_all.t
cpan/Test-Simple/t/Legacy/Regression/637.t
cpan/Test-Simple/t/Legacy/Regression/683_thread_todo.t
cpan/Test-Simple/t/Legacy/Regression/6_cmp_ok.t
cpan/Test-Simple/t/Legacy/Regression/736_use_ok.t
cpan/Test-Simple/t/Legacy/require_ok.t
cpan/Test-Simple/t/Legacy/run_test.t
cpan/Test-Simple/t/Legacy/simple.t
Expand Down Expand Up @@ -2748,6 +2750,7 @@ cpan/Test-Simple/t/Legacy/useing.t
cpan/Test-Simple/t/Legacy/utf8.t
cpan/Test-Simple/t/Legacy/versions.t
cpan/Test-Simple/t/Legacy_And_Test2/builder_loaded_late.t
cpan/Test-Simple/t/Legacy_And_Test2/hidden_warnings.t
cpan/Test-Simple/t/lib/Dev/Null.pm
cpan/Test-Simple/t/lib/Dummy.pm
cpan/Test-Simple/t/lib/MyOverload.pm
Expand Down
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ package Maintainers;
},

'Test::Simple' => {
'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302062.tar.gz',
'DISTRIBUTION' => 'EXODIST/Test-Simple-1.302067.tar.gz',
'FILES' => q[cpan/Test-Simple],
'EXCLUDED' => [
qr{^examples/},
Expand Down
34 changes: 32 additions & 2 deletions cpan/Test-Simple/lib/Test/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use 5.006;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';

BEGIN {
if( $] < 5.008 ) {
Expand Down Expand Up @@ -238,6 +238,7 @@ sub finalize {
my $plan = $chub->plan || 0;
my $count = $chub->count;
my $failed = $chub->failed;
my $passed = $chub->is_passing;

my $num_extra = $plan =~ m/\D/ ? 0 : $count - $plan;
if ($count && $num_extra != 0) {
Expand All @@ -257,6 +258,12 @@ Looks like you failed $failed test$s of $count$qualifier.
FAIL
}

if (!$passed && !$failed && $count && !$num_extra) {
$st_ctx->diag(<<"FAIL");
All assertions inside the subtest passed, but errors were encountered.
FAIL
}

$st_ctx->release;

unless ($chub->bailed_out) {
Expand Down Expand Up @@ -919,7 +926,20 @@ END
$self->_is_diag( $got, $type, $expect );
}
elsif( $type =~ /^(ne|!=)$/ ) {
$self->_isnt_diag( $got, $type );
no warnings;
my $eq = ($got eq $expect || $got == $expect)
&& (
(defined($got) xor defined($expect))
|| (length($got) != length($expect))
);
use warnings;

if ($eq) {
$self->_cmp_diag( $got, $type, $expect );
}
else {
$self->_isnt_diag( $got, $type );
}
}
else {
$self->_cmp_diag( $got, $type, $expect );
Expand Down Expand Up @@ -1550,6 +1570,7 @@ sub _ending {
my $plan = $hub->plan;
my $count = $hub->count;
my $failed = $hub->failed;
my $passed = $hub->is_passing;
return unless $plan || $count || $failed;

# Ran tests but never declared a plan or hit done_testing
Expand Down Expand Up @@ -1622,13 +1643,22 @@ Looks like you failed $failed test$s of $count$qualifier.
FAIL
}

if (!$passed && !$failed && $count && !$num_extra) {
$ctx->diag(<<"FAIL");
All assertions passed, but errors were encountered.
FAIL
}

my $exit_code = 0;
if ($failed) {
$exit_code = $failed <= 254 ? $failed : 254;
}
elsif ($num_extra != 0) {
$exit_code = 255;
}
elsif (!$passed) {
$exit_code = 255;
}

$$new ||= $exit_code;
return;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder/Formatter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Test::Builder::Formatter;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';

BEGIN { require Test2::Formatter::TAP; our @ISA = qw(Test2::Formatter::TAP) }

Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder/Module.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Test::Builder;
require Exporter;
our @ISA = qw(Exporter);

our $VERSION = '1.302062';
our $VERSION = '1.302067';


=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder/Tester.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Test::Builder::Tester;

use strict;
our $VERSION = '1.302062';
our $VERSION = '1.302067';

use Test::Builder;
use Symbol;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Test::Builder::Tester::Color;

use strict;
our $VERSION = '1.302062';
our $VERSION = '1.302067';

require Test::Builder::Tester;

Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Builder/TodoDiag.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Test::Builder::TodoDiag;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';

BEGIN { require Test2::Event::Diag; our @ISA = qw(Test2::Event::Diag) }

Expand Down
13 changes: 8 additions & 5 deletions cpan/Test-Simple/lib/Test/More.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sub _carp {
return warn @_, " at $file line $line\n";
}

our $VERSION = '1.302062';
our $VERSION = '1.302067';

use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
Expand Down Expand Up @@ -976,7 +976,10 @@ sub use_ok ($;@) {
@imports = () unless @imports;
my $tb = Test::More->builder;

my( $pack, $filename, $line ) = caller;
my %caller;
@caller{qw/pack file line sub args want eval req strict warn/} = caller(0);

my ($pack, $filename, $line, $warn) = @caller{qw/pack file line warn/};
$filename =~ y/\n\r/_/; # so it doesn't run off the "#line $line $f" line

my $code;
Expand All @@ -985,7 +988,7 @@ sub use_ok ($;@) {
# for it to work with non-Exporter based modules.
$code = <<USE;
package $pack;
BEGIN { \${^WARNING_BITS} = \$args[-1] if defined \$args[-1] }
#line $line $filename
use $module $imports[0];
1;
Expand All @@ -994,14 +997,14 @@ USE
else {
$code = <<USE;
package $pack;
BEGIN { \${^WARNING_BITS} = \$args[-1] if defined \$args[-1] }
#line $line $filename
use $module \@{\$args[0]};
1;
USE
}

my( $eval_result, $eval_error ) = _eval( $code, \@imports );
my ($eval_result, $eval_error) = _eval($code, \@imports, $warn);
my $ok = $tb->ok( $eval_result, "use $module;" );

unless($ok) {
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use 5.006;

use strict;

our $VERSION = '1.302062';
our $VERSION = '1.302067';

use Test::Builder::Module;
our @ISA = qw(Test::Builder::Module);
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Tester.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require Exporter;

use vars qw( @ISA @EXPORT );

our $VERSION = '1.302062';
our $VERSION = '1.302067';

@EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
@ISA = qw( Exporter );
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Tester/Capture.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;

package Test::Tester::Capture;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


use Test::Builder;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/Tester/CaptureRunner.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use strict;

package Test::Tester::CaptureRunner;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


use Test::Tester::Capture;
Expand Down
12 changes: 11 additions & 1 deletion cpan/Test-Simple/lib/Test/Tester/Delegate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use warnings;

package Test::Tester::Delegate;

our $VERSION = '1.302062';
our $VERSION = '1.302067';

use Scalar::Util();

use vars '$AUTOLOAD';

Expand Down Expand Up @@ -32,4 +33,13 @@ sub AUTOLOAD
goto &$ref;
}

sub can {
my $this = shift;
my ($sub) = @_;

return $this->{Object}->can($sub) if Scalar::Util::blessed($this);

return $this->SUPER::can(@_);
}

1;
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test/use/ok.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Test::use::ok;
use 5.005;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


__END__
Expand Down
12 changes: 6 additions & 6 deletions cpan/Test-Simple/lib/Test2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Test2;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


1;
Expand Down Expand Up @@ -174,11 +174,11 @@ C<intercept()> and C<run_subtest()> are implemented.
=head1 CONTACTING US
Many Test2 developers and users lurk on L<irc://irc.perl.org/#perl>. We also
have a slack team that can be joined by anyone with an C<@cpan.org> email
address L<https://perl-test2.slack.com/> If you do not have an C<@cpan.org>
email you can ask for a slack invite by emailing Chad Granum
E<lt>[email protected]E<gt>.
Many Test2 developers and users lurk on L<irc://irc.perl.org/#perl-qa> and
L<irc://irc.perl.org/#toolchain>. We also have a slack team that can be joined
by anyone with an C<@cpan.org> email address L<https://perl-test2.slack.com/>
If you do not have an C<@cpan.org> email you can ask for a slack invite by
emailing Chad Granum E<lt>[email protected]E<gt>.
=head1 SOURCE
Expand Down
7 changes: 6 additions & 1 deletion cpan/Test-Simple/lib/Test2/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ package Test2::API;
use strict;
use warnings;

our $VERSION = '1.302062';
BEGIN {
$ENV{TEST_ACTIVE} ||= 1;
$ENV{TEST2_ACTIVE} = 1;
}

our $VERSION = '1.302067';


my $INST;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Simple/lib/Test2/API/Breakage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Test2::API::Breakage;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


use Test2::Util qw/pkg_to_file/;
Expand Down
11 changes: 7 additions & 4 deletions cpan/Test-Simple/lib/Test2/API/Context.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package Test2::API::Context;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


use Carp qw/confess croak longmess/;
use Scalar::Util qw/weaken/;
use Scalar::Util qw/weaken blessed/;
use Test2::Util qw/get_tid try pkg_to_file get_tid/;

use Test2::Util::Trace();
Expand All @@ -25,7 +25,7 @@ my %LOADED = (
use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/;
use Test2::Util::HashBase qw{
stack hub trace _on_release _depth _is_canon _is_spawn _aborted
errno eval_error child_error
errno eval_error child_error thrown
};

# Private, not package vars
Expand Down Expand Up @@ -114,6 +114,8 @@ Cleaning up the CONTEXT stack...
sub release {
my ($self) = @_;

($!, $@, $?) = @$self{+ERRNO, +EVAL_ERROR, +CHILD_ERROR} and return if $self->{+THROWN};

($!, $@, $?) = @$self{+ERRNO, +EVAL_ERROR, +CHILD_ERROR} and return $self->{+_IS_SPAWN} = undef
if $self->{+_IS_SPAWN};

Expand Down Expand Up @@ -189,6 +191,7 @@ sub done_testing {

sub throw {
my ($self, $msg) = @_;
$self->{+THROWN} = 1;
${$self->{+_ABORTED}}++ if $self->{+_ABORTED};
$self->release if $self->{+_IS_CANON} || $self->{+_IS_SPAWN};
$self->trace->throw($msg);
Expand Down Expand Up @@ -248,7 +251,7 @@ sub ok {

if ($on_fail && @$on_fail) {
for my $of (@$on_fail) {
if (ref($of)) {
if (ref($of) eq 'CODE' || (blessed($of) && $of->can('render'))) {
$self->info($of, diagnostics => 1);
}
else {
Expand Down
10 changes: 9 additions & 1 deletion cpan/Test-Simple/lib/Test2/API/Instance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Test2::API::Instance;
use strict;
use warnings;

our $VERSION = '1.302062';
our $VERSION = '1.302067';


our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::Formatter/;
Expand Down Expand Up @@ -304,6 +304,13 @@ sub ipc_enable_shm {
$self->{+_TID} = get_tid() unless defined $self->{+_TID};

my ($ok, $err) = try {
# SysV IPC can be available but not enabled.
#
# In some systems (*BSD) accessing the SysV IPC APIs without
# them being enabled can cause a SIGSYS. We suppress the SIGSYS
# and then get ENOSYS from the calls.
local $SIG{SYS} = 'IGNORE';

require IPC::SysV;

my $ipc_key = IPC::SysV::IPC_PRIVATE();
Expand Down Expand Up @@ -488,6 +495,7 @@ This is not a supported configuration, you will have problems.
$root->finalize($trace) unless $root->ended;
$_->($ctx, $exit, \$new_exit) for @{$self->{+EXIT_CALLBACKS}};
$new_exit ||= $root->failed;
$new_exit ||= 255 unless $root->is_passing;
}
}

Expand Down
Loading

0 comments on commit d45cc9a

Please sign in to comment.