Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

perl blead: Test-Simple Version Bump, 1.301001_096 (RC16) #14390

Closed p5pRT closed 9 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#123540 (status was 'resolved')

Searchable as RT123540$

p5pRT commented 9 years ago

From @exodist

This brings the perl blead Test-Simple in line with what is currently on cpan.

p5pRT commented 9 years ago

From @exodist

0001-Test-Simple-Version-Bump-1.301001_096-RC16.patch ```diff From 7f04a84194e4f266c1978396dd02df8956f9eda4 Mon Sep 17 00:00:00 2001 From: Chad Granum Date: Sat, 3 Jan 2015 13:04:16 -0800 Subject: [PATCH] Test-Simple Version Bump, 1.301001_096 (RC16) Mainly fixes for older perls. Still important to bring this in line with what is on cpan. --- cpan/Test-Simple/lib/Test/Builder.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/CanThread.pm | 29 +++++++++++++++++++---- cpan/Test-Simple/lib/Test/More.pm | 2 +- cpan/Test-Simple/lib/Test/Simple.pm | 4 ++-- cpan/Test-Simple/lib/Test/Stream.pm | 2 +- cpan/Test-Simple/lib/Test/Stream/Block.pm | 16 +++++++++---- cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm | 3 ++- cpan/Test-Simple/lib/Test/Tester.pm | 2 +- cpan/Test-Simple/lib/Test/use/ok.pm | 2 +- cpan/Test-Simple/lib/ok.pm | 2 +- cpan/Test-Simple/t/Test-Stream-Exporter.t | 8 ------- cpan/Test-Simple/t/Test-Stream-PackageUtil.t | 4 ++-- 15 files changed, 51 insertions(+), 31 deletions(-) diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index 1528248..03da6e2 100644 --- a/cpan/Test-Simple/lib/Test/Builder.pm +++ b/cpan/Test-Simple/lib/Test/Builder.pm @@ -4,7 +4,7 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) diff --git a/cpan/Test-Simple/lib/Test/Builder/Module.pm b/cpan/Test-Simple/lib/Test/Builder/Module.pm index e31eded..fc37bf2 100644 --- a/cpan/Test-Simple/lib/Test/Builder/Module.pm +++ b/cpan/Test-Simple/lib/Test/Builder/Module.pm @@ -8,7 +8,7 @@ use Test::Builder 0.99; require Exporter; our @ISA = qw(Exporter); -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester.pm b/cpan/Test-Simple/lib/Test/Builder/Tester.pm index 367608f..d8b5836 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.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; diff --git a/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm b/cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm index e5d91a1..441e4ba 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.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; diff --git a/cpan/Test-Simple/lib/Test/CanThread.pm b/cpan/Test-Simple/lib/Test/CanThread.pm index 58ac8da..0e022f0 100644 --- a/cpan/Test-Simple/lib/Test/CanThread.pm +++ b/cpan/Test-Simple/lib/Test/CanThread.pm @@ -12,11 +12,6 @@ $works &&= eval { require threads; 'threads'->import; 1 }; sub import { my $class = shift; - if ($] == 5.010000) { - require Test::More; - Test::More::plan(skip_all => "Threads are broken on 5.10.0"); - } - unless ($works) { require Test::More; Test::More::plan(skip_all => "Skip no working threads"); @@ -34,6 +29,30 @@ sub import { Test::More::plan(skip_all => "This threaded test will only run when the '$var' environment variable is set."); } + if ($] == 5.010000) { + require File::Temp; + require File::Spec; + + my $perl = File::Spec->rel2abs($^X); + my ($fh, $fn) = File::Temp::tempfile(); + print $fh <<' EOT'; + BEGIN { print STDERR "# Checking for thread segfaults\n# " } + use threads; + my $t = threads->create(sub { 1 }); + $t->join; + print STDERR "Threads appear to work\n"; + exit 0; + EOT + close($fh); + + my $exit = system(qq{"$perl" "$fn"}); + + if ($exit) { + require Test::More; + Test::More::plan(skip_all => "Threads segfault on this perl"); + } + } + my $caller = caller; eval "package $caller; use threads; 1" || die $@; } diff --git a/cpan/Test-Simple/lib/Test/More.pm b/cpan/Test-Simple/lib/Test/More.pm index c0d958e..39e65d4 100644 --- a/cpan/Test-Simple/lib/Test/More.pm +++ b/cpan/Test-Simple/lib/Test/More.pm @@ -4,7 +4,7 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; diff --git a/cpan/Test-Simple/lib/Test/Simple.pm b/cpan/Test-Simple/lib/Test/Simple.pm index ac30ea4..500abb1 100644 --- a/cpan/Test-Simple/lib/Test/Simple.pm +++ b/cpan/Test-Simple/lib/Test/Simple.pm @@ -5,10 +5,10 @@ use 5.008001; use strict; use warnings; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) -use Test::Stream 1.301001_093 '-internal'; +use Test::Stream 1.301001_096 '-internal'; use Test::Stream::Toolset; use Test::Stream::Exporter; diff --git a/cpan/Test-Simple/lib/Test/Stream.pm b/cpan/Test-Simple/lib/Test/Stream.pm index 0690625..8ddab7e 100644 --- a/cpan/Test-Simple/lib/Test/Stream.pm +++ b/cpan/Test-Simple/lib/Test/Stream.pm @@ -2,7 +2,7 @@ package Test::Stream; use strict; use warnings; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream::Context qw/context/; diff --git a/cpan/Test-Simple/lib/Test/Stream/Block.pm b/cpan/Test-Simple/lib/Test/Stream/Block.pm index 9acb851..7f6bd68 100644 --- a/cpan/Test-Simple/lib/Test/Stream/Block.pm +++ b/cpan/Test-Simple/lib/Test/Stream/Block.pm @@ -28,7 +28,16 @@ sub init { confess "coderef must be a code reference" unless ref($self->[CODEREF]) && reftype($self->[CODEREF]) eq 'CODE'; - require B; + $self->deduce; + + $self->[PARAMS] ||= {}; +} + +sub deduce { + my $self = shift; + + eval { require B; 1 } || return; + my $code = $self->[CODEREF]; my $cobj = B::svref_2object($code); my $pkg = $cobj->GV->STASH->NAME; @@ -38,9 +47,8 @@ sub init { $SUB_MAPS{$file}->{$line} = $self->[NAME]; - $self->[DEDUCED] = [$pkg, $file, $line, $subname]; - $self->[NAME] ||= $subname; - $self->[PARAMS] ||= {}; + $self->[DEDUCED] = [$pkg, $file, $line, $subname]; + $self->[NAME] ||= $subname; } sub merge_params { diff --git a/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm b/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm index 6b871df..f2a2a8c 100644 --- a/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm +++ b/cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm @@ -60,7 +60,8 @@ sub package_purge_sym { no strict 'refs'; local *GLOBCLONE = *{"$pkg\::$name"}; - undef *{"$pkg\::$name"}; + my $stash = \%{"${pkg}\::"}; + delete $stash->{$name}; for my $slot (@SLOTS) { next if $slot eq $purge; *{"$pkg\::$name"} = *GLOBCLONE{$slot} if defined *GLOBCLONE{$slot}; diff --git a/cpan/Test-Simple/lib/Test/Tester.pm b/cpan/Test-Simple/lib/Test/Tester.pm index deb192c..6f0a44e 100644 --- a/cpan/Test-Simple/lib/Test/Tester.pm +++ b/cpan/Test-Simple/lib/Test/Tester.pm @@ -16,7 +16,7 @@ require Exporter; use vars qw( @ISA @EXPORT $VERSION ); -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) @EXPORT = qw( run_tests check_tests check_test cmp_results show_space ); diff --git a/cpan/Test-Simple/lib/Test/use/ok.pm b/cpan/Test-Simple/lib/Test/use/ok.pm index d241554..144d289 100644 --- a/cpan/Test-Simple/lib/Test/use/ok.pm +++ b/cpan/Test-Simple/lib/Test/use/ok.pm @@ -3,7 +3,7 @@ use strict; use warnings; use 5.005; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; diff --git a/cpan/Test-Simple/lib/ok.pm b/cpan/Test-Simple/lib/ok.pm index d1b2341..d96d65e 100644 --- a/cpan/Test-Simple/lib/ok.pm +++ b/cpan/Test-Simple/lib/ok.pm @@ -6,7 +6,7 @@ use Test::Stream 1.301001 '-internal'; use Test::More 1.301001 (); use Test::Stream::Carp qw/croak/; -our $VERSION = '1.301001_093'; +our $VERSION = '1.301001_096'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) sub import { diff --git a/cpan/Test-Simple/t/Test-Stream-Exporter.t b/cpan/Test-Simple/t/Test-Stream-Exporter.t index 1477867..6d9097c 100644 --- a/cpan/Test-Simple/t/Test-Stream-Exporter.t +++ b/cpan/Test-Simple/t/Test-Stream-Exporter.t @@ -27,14 +27,6 @@ use Test::More; is($main::export::xxx, 'here', "still have an \$export::* var"); ok(!__PACKAGE__->can($_), "removed $_\()") for qw/export default_export exports default_exports/; - - my $ok = eval { - export no => sub { 'no' }; - 1; - }; - my $error = $@; - ok(!$ok, "Cannot add exports after cleanup"); - like($error, qr/Undefined subroutine &My::Exporter::export called/, "Sub was removed"); } My::Exporter->import( '!x' ); diff --git a/cpan/Test-Simple/t/Test-Stream-PackageUtil.t b/cpan/Test-Simple/t/Test-Stream-PackageUtil.t index e55c0f9..76d80d8 100644 --- a/cpan/Test-Simple/t/Test-Stream-PackageUtil.t +++ b/cpan/Test-Simple/t/Test-Stream-PackageUtil.t @@ -29,10 +29,10 @@ package_purge_sym(__PACKAGE__, CODE => 'foo'); is($foo, 'foo', '$foo is still defined'); is_deeply(\@foo, [ 'f', 'o', 'o' ], '@foo is still defined'); is_deeply(\%foo, { f => 'oo' }, '%foo is still defined'); -my $r = eval { foo() }; +my $r = eval { __PACKAGE__->foo() }; my $e = $@; ok(!$r, "Failed to call foo()"); -like($e, qr/Undefined subroutine &main::foo called/, "foo() is not defined anymore"); +like($e, qr/Can't locate object method "foo" via package "main"/, "foo() is not defined anymore"); ok(!__PACKAGE__->can('foo'), "can() no longer thinks we can do foo()"); done_testing; -- 1.9.1 ```
p5pRT commented 9 years ago

From @jkeenan

Pushed to blead in commit fa87ec39c0ab9e6a9009caf5bc528efa6dc8aabc

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

@jkeenan - Status changed from 'open' to 'resolved'