In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/109b7e48097d1bc00b162c55d646e7cd2c46562b?hp=f40bbcbf5ba1171b1c25dff271e9a7c0ba9ad29f>
- Log ----------------------------------------------------------------- commit 109b7e48097d1bc00b162c55d646e7cd2c46562b Author: Father Chrysostomos <[email protected]> Date: Sun Nov 23 19:25:00 2014 -0800 perl5220delta: Hook::LexWrap is fixed M Porting/perl5220delta.pod commit 5ad2b8fa83eeed5c77e5a670303b423ce7bcbfe3 Author: Father Chrysostomos <[email protected]> Date: Sun Nov 23 19:24:38 2014 -0800 known_pod_issues.dat: 2 more known mods M t/porting/known_pod_issues.dat commit 4dfb99cbd7762bd6cad9242b2ae309cf18db2f68 Author: Father Chrysostomos <[email protected]> Date: Sun Nov 23 17:44:44 2014 -0800 Add 2 more problematic mods to perl5220delta M Porting/perl5220delta.pod commit 2e52a9b8712c6c0077b2c34feaedc8404f7af7d5 Author: Chad Granum <[email protected]> Date: Sun Nov 23 16:24:50 2014 -0800 Update Test-Simple to Alpha 078 M MANIFEST M cpan/Test-Simple/lib/Test/Builder.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 A cpan/Test-Simple/lib/Test/CanFork.pm A cpan/Test-Simple/lib/Test/CanThread.pm M cpan/Test-Simple/lib/Test/More.pm M cpan/Test-Simple/lib/Test/Simple.pm M cpan/Test-Simple/lib/Test/Stream.pm A cpan/Test-Simple/lib/Test/Stream/ForceExit.pm M cpan/Test-Simple/lib/Test/Tester.pm M cpan/Test-Simple/lib/Test/use/ok.pm M cpan/Test-Simple/lib/ok.pm M cpan/Test-Simple/t/Behavior/388-threadedsubtest.t M cpan/Test-Simple/t/Behavior/fork_new_end.t M cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t M cpan/Test-Simple/t/Legacy/Builder/fork_with_new_stdout.t M cpan/Test-Simple/t/Legacy/fork.t M cpan/Test-Simple/t/Legacy/fork_die.t M cpan/Test-Simple/t/Legacy/fork_in_subtest.t M cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t M cpan/Test-Simple/t/Legacy/ribasushi_threads.t M cpan/Test-Simple/t/Legacy/ribasushi_threads2.t M cpan/Test-Simple/t/Legacy/subtest/fork.t M cpan/Test-Simple/t/Legacy/subtest/threads.t M cpan/Test-Simple/t/Legacy/threads.t A cpan/Test-Simple/t/Test-Stream-ForceExit.t commit e41e9865be5555602763ac0cf98065a8f3f38189 Author: Father Chrysostomos <[email protected]> Date: Sun Nov 23 16:58:45 2014 -0800 [perl #123062] & proto: only sub{} and \&sub It was allowing \@array, \%hash, \($list, %of, @refs), undef, and recently also \$scalar. It should only allow sub{} and \&sub. M op.c M t/comp/proto.t ----------------------------------------------------------------------- Summary of changes: MANIFEST | 4 + Porting/perl5220delta.pod | 6 +- 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/CanFork.pm | 94 +++++++++++++++++++ cpan/Test-Simple/lib/Test/CanThread.pm | 103 +++++++++++++++++++++ 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/ForceExit.pm | 97 +++++++++++++++++++ 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/Behavior/388-threadedsubtest.t | 26 +----- cpan/Test-Simple/t/Behavior/fork_new_end.t | 25 +---- .../t/Behavior/threads_with_taint_mode.t | 41 +++----- .../t/Legacy/Builder/fork_with_new_stdout.t | 20 +--- cpan/Test-Simple/t/Legacy/fork.t | 19 +--- cpan/Test-Simple/t/Legacy/fork_die.t | 19 +--- cpan/Test-Simple/t/Legacy/fork_in_subtest.t | 21 +---- cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t | 23 +---- cpan/Test-Simple/t/Legacy/ribasushi_threads.t | 35 +------ cpan/Test-Simple/t/Legacy/ribasushi_threads2.t | 32 +------ cpan/Test-Simple/t/Legacy/subtest/fork.t | 22 +---- cpan/Test-Simple/t/Legacy/subtest/threads.t | 10 +- cpan/Test-Simple/t/Legacy/threads.t | 24 +---- cpan/Test-Simple/t/Test-Stream-ForceExit.t | 69 ++++++++++++++ op.c | 7 +- t/comp/proto.t | 17 +++- t/porting/known_pod_issues.dat | 2 + 32 files changed, 439 insertions(+), 299 deletions(-) create mode 100644 cpan/Test-Simple/lib/Test/CanFork.pm create mode 100644 cpan/Test-Simple/lib/Test/CanThread.pm create mode 100644 cpan/Test-Simple/lib/Test/Stream/ForceExit.pm create mode 100644 cpan/Test-Simple/t/Test-Stream-ForceExit.t diff --git a/MANIFEST b/MANIFEST index bd4a00a..f5126e0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2259,6 +2259,8 @@ cpan/Test-Simple/lib/Test/Builder/Module.pm Test::Simple module cpan/Test-Simple/lib/Test/Builder.pm Test::Simple module cpan/Test-Simple/lib/Test/Builder/Tester/Color.pm Test::Simple module cpan/Test-Simple/lib/Test/Builder/Tester.pm Test::Simple module +cpan/Test-Simple/lib/Test/CanFork.pm Test::Simple module +cpan/Test-Simple/lib/Test/CanThread.pm Test::Simple module cpan/Test-Simple/lib/Test/FAQ.pod Test::Simple module cpan/Test-Simple/lib/Test/More/DeepCheck.pm Test::Simple module cpan/Test-Simple/lib/Test/More/DeepCheck/Strict.pm Test::Simple module @@ -2285,6 +2287,7 @@ cpan/Test-Simple/lib/Test/Stream/ExitMagic/Context.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/ExitMagic.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/Exporter/Meta.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/Exporter.pm Test::Simple module +cpan/Test-Simple/lib/Test/Stream/ForceExit.pm Test-Simple module cpan/Test-Simple/lib/Test/Stream/IOSets.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/Meta.pm Test::Simple module cpan/Test-Simple/lib/Test/Stream/PackageUtil.pm Test::Simple module @@ -2486,6 +2489,7 @@ cpan/Test-Simple/t/Test-Stream-Event.t Test::Simple Test cpan/Test-Simple/t/Test-Stream-ExitMagic-Context.t Test::Simple Test cpan/Test-Simple/t/Test-Stream-Exporter-Meta.t Test::Simple Test cpan/Test-Simple/t/Test-Stream-Exporter.t Test::Simple Test +cpan/Test-Simple/t/Test-Stream-ForceExit.t Test-Simple test cpan/Test-Simple/t/Test-Stream-IOSets.t Test::Simple Test cpan/Test-Simple/t/Test-Stream-Meta.t Test::Simple Test cpan/Test-Simple/t/Test-Stream-PackageUtil.t Test::Simple Test diff --git a/Porting/perl5220delta.pod b/Porting/perl5220delta.pod index 6f3cb30..b72b023 100644 --- a/Porting/perl5220delta.pod +++ b/Porting/perl5220delta.pod @@ -365,6 +365,10 @@ soon: =item * +L<B::Utils> version 0.25 + +=item * + L<Dancer> version 1.3130 =item * @@ -385,7 +389,7 @@ L<Future> version 0.29 =item * -L<Hook::LexWrap> version 0.24 +L<Mason> version 2.22 =item * diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm index aa9a417..2144c93 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_076'; +our $VERSION = '1.301001_078'; $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 79340ed..0ff9ce1 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_076'; +our $VERSION = '1.301001_078'; $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 dfdfc5e..7b2e9b4 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_076'; +our $VERSION = '1.301001_078'; $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 6498c6a..dfdb50d 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_076'; +our $VERSION = '1.301001_078'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream 1.301001 '-internal'; diff --git a/cpan/Test-Simple/lib/Test/CanFork.pm b/cpan/Test-Simple/lib/Test/CanFork.pm new file mode 100644 index 0000000..b28a382 --- /dev/null +++ b/cpan/Test-Simple/lib/Test/CanFork.pm @@ -0,0 +1,94 @@ +package Test::CanFork; +use strict; +use warnings; + +use Config; + +my $Can_Fork = $Config{d_fork} + || (($^O eq 'MSWin32' || $^O eq 'NetWare') + and $Config{useithreads} + and $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); + +if (!$Can_Fork) { + require Test::More; + Test::More::plan(skip_all => "This system cannot fork"); + exit 0; +} + +if ($^O eq 'MSWin32' && $] == 5.010000) { + require Test::More; + Test::More::plan('skip_all' => "5.10 has fork/threading issues that break fork on win32"); + exit 0; +} + +sub import { + my $class = shift; + for my $var (@_) { + next if $ENV{$var}; + + require Test::More; + Test::More::plan(skip_all => "This forking test will only run when the '$var' environment variable is set."); + exit 0; + } +} + +1; + +__END__ + +=head1 NAME + +Test::CanFork - Only run tests when forking is supported, optionally conditioned on ENV vars. + +=head1 DESCRIPTION + +Use this first thing in a test that should be skipped when forking is not +supported. You can also specify that the test should be skipped when specific +environment variables are not set. + +=head1 SYNOPSYS + +Skip the test if forking is unsupported: + + use Test::CanFork; + use Test::More; + ... + +Skip the test if forking is unsupported, or any of the specified env vars are +not set: + + use Test::CanFork qw/AUTHOR_TESTING RUN_PROBLEMATIC_TESTS .../; + use Test::More; + ... + +=head1 SOURCE + +The source code repository for Test::More can be found at +F<http://github.com/Test-More/test-more/>. + +=head1 MAINTAINER + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 COPYRIGHT + +Copyright 2014 Chad Granum E<lt>[email protected]<gt>. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See F<http://www.perl.com/perl/misc/Artistic.html> + +=cut diff --git a/cpan/Test-Simple/lib/Test/CanThread.pm b/cpan/Test-Simple/lib/Test/CanThread.pm new file mode 100644 index 0000000..a9d6aeb --- /dev/null +++ b/cpan/Test-Simple/lib/Test/CanThread.pm @@ -0,0 +1,103 @@ +package Test::CanThread; +use strict; +use warnings; + +use Config; + +if ($] == 5.010000) { + require Test::More; + Test::More::plan(skip_all => "Threads are broken on 5.10.0"); + exit 0; +} + +my $works = 1; +$works &&= $] >= 5.008001; +$works &&= $Config{'useithreads'}; +$works &&= eval { require threads; 'threads'->import; 1 }; + +unless ($works) { + require Test::More; + Test::More::plan(skip_all => "Skip no working threads"); + exit 0; +} + +if ($INC{'Devel/Cover.pm'}) { + require Test::More; + Test::More::plan(skip_all => "Devel::Cover does not work with threads yet"); + exit 0; +} + +sub import { + my $class = shift; + while(my $var = shift(@_)) { + next if $ENV{$var}; + + require Test::More; + Test::More::plan(skip_all => "This threaded test will only run when the '$var' environment variable is set."); + exit 0; + } + + unshift @_ => 'threads'; + goto &threads::import; +} + +1; + +__END__ + +=head1 NAME + +Test::CanThread - Only run tests when threading is supported, optionally conditioned on ENV vars. + +=head1 DESCRIPTION + +Use this first thing in a test that should be skipped when threading is not +supported. You can also specify that the test should be skipped when specific +environment variables are not set. + +=head1 SYNOPSYS + +Skip the test if threading is unsupported: + + use Test::CanThread; + use Test::More; + ... + +Skip the test if threading is unsupported, or any of the specified env vars are +not set: + + use Test::CanThread qw/AUTHOR_TESTING RUN_PROBLEMATIC_TESTS .../; + use Test::More; + ... + +=head1 SOURCE + +The source code repository for Test::More can be found at +F<http://github.com/Test-More/test-more/>. + +=head1 MAINTAINER + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 COPYRIGHT + +Copyright 2014 Chad Granum E<lt>[email protected]<gt>. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See F<http://www.perl.com/perl/misc/Artistic.html> + +=cut diff --git a/cpan/Test-Simple/lib/Test/More.pm b/cpan/Test-Simple/lib/Test/More.pm index d1b7e65..585fd8a 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_076'; +our $VERSION = '1.301001_078'; $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 297c490..61cc2c3 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_076'; +our $VERSION = '1.301001_078'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) -use Test::Stream 1.301001_076 '-internal'; +use Test::Stream 1.301001_078 '-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 6decda3..2011c5b 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_076'; +our $VERSION = '1.301001_078'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) use Test::Stream::Context qw/context/; diff --git a/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm b/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm new file mode 100644 index 0000000..e32edfb --- /dev/null +++ b/cpan/Test-Simple/lib/Test/Stream/ForceExit.pm @@ -0,0 +1,97 @@ +package Test::Stream::ForceExit; +use strict; +use warnings; + +sub new { + my $class = shift; + + my $done = 0; + my $self = \$done; + + return bless $self, $class; +} + +sub done { + my $self = shift; + ($$self) = @_ if @_; + return $$self; +} + +sub DESTROY { + my $self = shift; + return if $self->done; + + warn "Something prevented child process $$ from exiting when it should have, Forcing exit now!\n"; + $self->done(1); # Prevent duplicate message during global destruction + exit 255; +} + +1; + +__END__ + +=head1 NAME + +Test::ForceExit - Ensure C<exit()> is called bvy the end of a scope, force the issue. + +=head1 DESCRIPTION + +Sometimes you need to fork. Sometimes the forked process can throw an exception +to exit. If you forked below an eval the exception will be cought and you +suddenly have an unexpected process running amok. This module can be used to +protect you from such issues. + +=head1 SYNOPSYS + + eval { + ... + + my $pid = fork; + + unless($pid) { + require Test::Stream::ForceExit; + my $force_exit = Test::Stream::ForceExit->new; + + thing_that_can_die(); + + # We did not die, turn off the forced exit. + $force_exit->done(1); + + # Do the exit we intend. + exit 0; + } + + ... + } + +=head1 SOURCE + +The source code repository for Test::More can be found at +F<http://github.com/Test-More/test-more/>. + +=head1 MAINTAINER + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum E<lt>[email protected]<gt> + +=back + +=head1 COPYRIGHT + +Copyright 2014 Chad Granum E<lt>[email protected]<gt>. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See F<http://www.perl.com/perl/misc/Artistic.html> + +=cut diff --git a/cpan/Test-Simple/lib/Test/Tester.pm b/cpan/Test-Simple/lib/Test/Tester.pm index 48e6c7d..5fd8b11 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_076'; +our $VERSION = '1.301001_078'; $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 b1ac438..72e9437 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_076'; +our $VERSION = '1.301001_078'; $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 18c6d2c..b83c7ec 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_076'; +our $VERSION = '1.301001_078'; $VERSION = eval $VERSION; ## no critic (BuiltinFunctions::ProhibitStringyEval) sub import { diff --git a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t b/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t index 44a586c..fae3783 100644 --- a/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t +++ b/cpan/Test-Simple/t/Behavior/388-threadedsubtest.t @@ -2,31 +2,7 @@ use strict; use warnings; -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ( $ENV{AUTHOR_TESTING} ) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } -} - -use threads; +use Test::CanThread qw/AUTHOR_TESTING/; use Test::More; subtest my_subtest => sub { diff --git a/cpan/Test-Simple/t/Behavior/fork_new_end.t b/cpan/Test-Simple/t/Behavior/fork_new_end.t index d15b9d9..7e7c2d7 100644 --- a/cpan/Test-Simple/t/Behavior/fork_new_end.t +++ b/cpan/Test-Simple/t/Behavior/fork_new_end.t @@ -8,30 +8,7 @@ BEGIN { } } -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ( $ENV{AUTHOR_TESTING} ) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } -} - +use Test::CanThread qw/AUTHOR_TESTING/; use Test::More tests => 4; ok(1, "outside before"); diff --git a/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t b/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t index 5f73ffa..71a80e9 100644 --- a/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t +++ b/cpan/Test-Simple/t/Behavior/threads_with_taint_mode.t @@ -1,47 +1,28 @@ #!/usr/bin/perl -w -T +use strict; +use warnings; BEGIN { - if( $ENV{PERL_CORE} ) { + if ($ENV{PERL_CORE}) { chdir 't'; @INC = '../lib'; } } -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; +use Test::CanThread qw/AUTHOR_TESTING/; - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ( $ENV{AUTHOR_TESTING} ) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } -} - -use strict; use Test::Builder; my $Test = Test::Builder->new; $Test->exported_to('main'); $Test->plan(tests => 6); -for(1..5) { - 'threads'->create(sub { - $Test->ok(1,"Each of these should app the test number") - })->join; +for (1 .. 5) { + 'threads'->create( + sub { + $Test->ok(1, "Each of these should app the test number"); + } + )->join; } -$Test->is_num($Test->current_test(), 5,"Should be five"); +$Test->is_num($Test->current_test(), 5, "Should be five"); diff --git a/cpan/Test-Simple/t/Legacy/Builder/fork_with_new_stdout.t b/cpan/Test-Simple/t/Legacy/Builder/fork_with_new_stdout.t index 5e20d81..5adb739 100644 --- a/cpan/Test-Simple/t/Legacy/Builder/fork_with_new_stdout.t +++ b/cpan/Test-Simple/t/Legacy/Builder/fork_with_new_stdout.t @@ -1,27 +1,15 @@ #!perl -w use strict; use warnings; + +use Test::CanFork; + use IO::Pipe; use Test::Builder; -use Config; my $b = Test::Builder->new; $b->reset; - -my $Can_Fork = $Config{d_fork} - || (($^O eq 'MSWin32' || $^O eq 'NetWare') - and $Config{useithreads} - and $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); - -if (!$Can_Fork) { - $b->plan('skip_all' => "This system cannot fork"); -} -elsif ($^O eq 'MSWin32' && $] == 5.010000) { - $b->plan('skip_all' => "5.10 has fork/threading issues that break fork on win32"); -} -else { - $b->plan('tests' => 2); -} +$b->plan('tests' => 2); my $pipe = IO::Pipe->new; if (my $pid = fork) { diff --git a/cpan/Test-Simple/t/Legacy/fork.t b/cpan/Test-Simple/t/Legacy/fork.t index ad02824..da7d464 100644 --- a/cpan/Test-Simple/t/Legacy/fork.t +++ b/cpan/Test-Simple/t/Legacy/fork.t @@ -7,24 +7,9 @@ BEGIN { } } -use Test::More; -use Config; +use Test::CanFork; -my $Can_Fork = $Config{d_fork} || - (($^O eq 'MSWin32' || $^O eq 'NetWare') and - $Config{useithreads} and - $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/ - ); - -if( !$Can_Fork ) { - plan skip_all => "This system cannot fork"; -} -elsif ($^O eq 'MSWin32' && $] == 5.010000) { - plan 'skip_all' => "5.10 has fork/threading issues that break fork on win32"; -} -else { - plan tests => 1; -} +use Test::More tests => 1; my $pid = fork; if( $pid ) { # parent diff --git a/cpan/Test-Simple/t/Legacy/fork_die.t b/cpan/Test-Simple/t/Legacy/fork_die.t index d649e1a..6728e28 100644 --- a/cpan/Test-Simple/t/Legacy/fork_die.t +++ b/cpan/Test-Simple/t/Legacy/fork_die.t @@ -1,27 +1,16 @@ use strict; use warnings; -use Config; - BEGIN { - my $Can_Fork = $Config{d_fork} || - (($^O eq 'MSWin32' || $^O eq 'NetWare') and - $Config{useithreads} and - $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/ - ); - - if( !$Can_Fork ) { - require Test::More; - Test::More::plan(skip_all => "This system cannot fork"); - exit 0; - } - elsif ($^O eq 'MSWin32' && $] == 5.010000) { + if ($^O eq 'MSWin32' || $^O eq 'NetWare') { require Test::More; - Test::More::plan('skip_all' => "5.10 has fork/threading issues that break fork on win32"); + Test::More::plan(skip_all => "This test is unreliable on $^O, also not likely to be helpful"); exit 0; } } +use Test::CanFork; + # The failure case for this test is producing 2 results, 1 pass and 1 fail, # both with the same test number. If this test file does anything other than 1 # (non-indented) result that passes, it has failed in one way or another. diff --git a/cpan/Test-Simple/t/Legacy/fork_in_subtest.t b/cpan/Test-Simple/t/Legacy/fork_in_subtest.t index b89cc5c..1a8dc16 100644 --- a/cpan/Test-Simple/t/Legacy/fork_in_subtest.t +++ b/cpan/Test-Simple/t/Legacy/fork_in_subtest.t @@ -1,26 +1,7 @@ use strict; use warnings; -use Config; - -BEGIN { - my $Can_Fork = $Config{d_fork} || - (($^O eq 'MSWin32' || $^O eq 'NetWare') and - $Config{useithreads} and - $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/ - ); - - if( !$Can_Fork ) { - require Test::More; - Test::More::plan(skip_all => "This system cannot fork"); - exit 0; - } - elsif ($^O eq 'MSWin32' && $] == 5.010000) { - require Test::More; - Test::More::plan('skip_all' => "5.10 has fork/threading issues that break fork on win32"); - exit 0; - } -} +use Test::CanFork; use Test::Stream 'enable_fork'; use Test::More; diff --git a/cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t b/cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t index 66a6641..50d2004 100644 --- a/cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t +++ b/cpan/Test-Simple/t/Legacy/is_deeply_with_threads.t @@ -13,29 +13,8 @@ BEGIN { } use strict; -use Config; -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ( $ENV{AUTHOR_TESTING} ) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } -} +use Test::CanThread qw/AUTHOR_TESTING/; use Test::More; diff --git a/cpan/Test-Simple/t/Legacy/ribasushi_threads.t b/cpan/Test-Simple/t/Legacy/ribasushi_threads.t index 32a7d1f..bbf3b67 100644 --- a/cpan/Test-Simple/t/Legacy/ribasushi_threads.t +++ b/cpan/Test-Simple/t/Legacy/ribasushi_threads.t @@ -1,37 +1,4 @@ -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ($ENV{AUTHOR_TESTING}) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } - - if ($INC{'Devel/Cover.pm'}) { - print "1..0 # SKIP Devel::Cover does not work with threads yet\n"; - exit 0; - } -} - -use threads; - -use strict; -use warnings; - +use Test::CanThread qw/AUTHOR_TESTING/; use Test::More; # basic tests diff --git a/cpan/Test-Simple/t/Legacy/ribasushi_threads2.t b/cpan/Test-Simple/t/Legacy/ribasushi_threads2.t index c60c61e..411a463 100644 --- a/cpan/Test-Simple/t/Legacy/ribasushi_threads2.t +++ b/cpan/Test-Simple/t/Legacy/ribasushi_threads2.t @@ -1,37 +1,7 @@ -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ($ENV{AUTHOR_TESTING}) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } - - if ($INC{'Devel/Cover.pm'}) { - print "1..0 # SKIP Devel::Cover does not work with threads yet\n"; - exit 0; - } -} - -use threads; - use strict; use warnings; +use Test::CanThread qw/AUTHOR_TESTING/; use Test::More; { diff --git a/cpan/Test-Simple/t/Legacy/subtest/fork.t b/cpan/Test-Simple/t/Legacy/subtest/fork.t index 76e9493..8d763a4 100644 --- a/cpan/Test-Simple/t/Legacy/subtest/fork.t +++ b/cpan/Test-Simple/t/Legacy/subtest/fork.t @@ -1,26 +1,12 @@ #!/usr/bin/perl -w use strict; use warnings; -use Config; + +use Test::CanFork; + use IO::Pipe; use Test::Builder; -use Test::More; - -my $Can_Fork = $Config{d_fork} || - (($^O eq 'MSWin32' || $^O eq 'NetWare') and - $Config{useithreads} and - $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/ - ); - -if( !$Can_Fork ) { - plan 'skip_all' => "This system cannot fork"; -} -elsif ($^O eq 'MSWin32' && $] == 5.010000) { - plan 'skip_all' => "5.10 has fork/threading issues that break fork on win32"; -} -else { - plan 'tests' => 1; -} +use Test::More tests => 1; subtest 'fork within subtest' => sub { plan tests => 2; diff --git a/cpan/Test-Simple/t/Legacy/subtest/threads.t b/cpan/Test-Simple/t/Legacy/subtest/threads.t index 5d053ca..df00f40 100644 --- a/cpan/Test-Simple/t/Legacy/subtest/threads.t +++ b/cpan/Test-Simple/t/Legacy/subtest/threads.t @@ -3,15 +3,7 @@ use strict; use warnings; -use Config; -BEGIN { - unless ( $] >= 5.008001 && $Config{'useithreads'} && - eval { require threads; 'threads'->import; 1; }) - { - print "1..0 # Skip: no working threads\n"; - exit 0; - } -} +use Test::CanThread; use Test::More; diff --git a/cpan/Test-Simple/t/Legacy/threads.t b/cpan/Test-Simple/t/Legacy/threads.t index 51b374d..28b0bd1 100644 --- a/cpan/Test-Simple/t/Legacy/threads.t +++ b/cpan/Test-Simple/t/Legacy/threads.t @@ -7,29 +7,7 @@ BEGIN { } } -use Config; - -BEGIN { - if ($] == 5.010000) { - print "1..0 # Threads are broken on 5.10.0\n"; - exit 0; - } - - my $works = 1; - $works &&= $] >= 5.008001; - $works &&= $Config{'useithreads'}; - $works &&= eval { require threads; 'threads'->import; 1 }; - - unless ($works) { - print "1..0 # Skip no working threads\n"; - exit 0; - } - - unless ( $ENV{AUTHOR_TESTING} ) { - print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; - exit 0; - } -} +use Test::CanThread qw/AUTHOR_TESTING/; use strict; use Test::Builder; diff --git a/cpan/Test-Simple/t/Test-Stream-ForceExit.t b/cpan/Test-Simple/t/Test-Stream-ForceExit.t new file mode 100644 index 0000000..6bae48c --- /dev/null +++ b/cpan/Test-Simple/t/Test-Stream-ForceExit.t @@ -0,0 +1,69 @@ +use Test::Stream::ForceExit; +use strict; +use warnings; + +use Test::CanFork; + +use Test::Stream qw/enable_fork/; +use Test::More; +use Test::Stream::ForceExit; + +my ($read, $write); +pipe($read, $write) || die "Failed to create a pipe."; + +my $pid = fork(); +unless ($pid) { + die "Failed to fork" unless defined $pid; + close($read); + $SIG{__WARN__} = sub { print $write @_ }; + + { + my $force_exit = Test::Stream::ForceExit->new; + diag "In Child"; + } + + print $write "Did not exit!"; + + ok(0, "Failed to exit"); + exit 0; +} + +close($write); +waitpid($pid, 0); +my $error = $?; +ok($error, "Got an error"); +my $msg = join("", <$read>); +is($msg, <<EOT, "Got warning"); +Something prevented child process $pid from exiting when it should have, Forcing exit now! +EOT + +close($read); +pipe($read, $write) || die "Failed to create a pipe."; + +$pid = fork(); +unless ($pid) { + die "Failed to fork" unless defined $pid; + close($read); + $SIG{__WARN__} = sub { print $write @_ }; + + { + my $force_exit = Test::Stream::ForceExit->new; + diag "In Child $$"; + $force_exit->done(1); + } + + print $write "Did not exit!\n"; + + exit 0; +} + +close($write); +waitpid($pid, 0); +$error = $?; +ok(!$error, "no error"); +$msg = join("", <$read>); +is($msg, <<EOT, "Did not exit early"); +Did not exit! +EOT + +done_testing; diff --git a/op.c b/op.c index c170a34..104d30f 100644 --- a/op.c +++ b/op.c @@ -11153,8 +11153,11 @@ Perl_ck_entersub_args_proto(pTHX_ OP *entersubop, GV *namegv, SV *protosv) case '&': proto++; arg++; - if (o3->op_type != OP_REFGEN && o3->op_type != OP_SREFGEN - && o3->op_type != OP_UNDEF) + if (o3->op_type != OP_SREFGEN + || ( cUNOPx(cUNOPx(o3)->op_first)->op_first->op_type + != OP_ANONCODE + && cUNOPx(cUNOPx(o3)->op_first)->op_first->op_type + != OP_RV2CV)) bad_type_gv(arg, arg == 1 ? "block or sub {}" : "sub {}", namegv, 0, o3); diff --git a/t/comp/proto.t b/t/comp/proto.t index f984aaf..0858160 100644 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -18,7 +18,7 @@ BEGIN { # strict use strict; -print "1..201\n"; +print "1..206\n"; my $i = 1; @@ -290,6 +290,21 @@ a_sub \&tmp_sub_1; eval 'a_sub @array'; print "not " unless $@; printf "ok %d\n",$i++; +eval 'a_sub \@array'; +print "not " unless $@ =~ /Type of arg/; +printf "ok %d\n",$i++; +eval 'a_sub \%hash'; +print "not " unless $@ =~ /Type of arg/; +printf "ok %d\n",$i++; +eval 'a_sub \$scalar'; +print "not " unless $@ =~ /Type of arg/; +printf "ok %d\n",$i++; +eval 'a_sub \($list, %of, @refs)'; +print "not " unless $@ =~ /Type of arg/; +printf "ok %d\n",$i++; +eval 'a_sub undef'; +print "not " unless $@ =~ /Type of arg/; +printf "ok %d\n",$i++; ## ## diff --git a/t/porting/known_pod_issues.dat b/t/porting/known_pod_issues.dat index 796984a..f1304fb 100644 --- a/t/porting/known_pod_issues.dat +++ b/t/porting/known_pod_issues.dat @@ -20,6 +20,7 @@ Array::Base Attribute::Constant B::Lint B::Lint::Debug +B::Utils basename(1) Benchmark::Perl::Formance ByteLoader @@ -104,6 +105,7 @@ Mail::Send Mail::SpamAssassin man(5) man(7) +Mason Math::Big Math::BigInt::Constant Math::BigInt::GMP -- Perl5 Master Repository
