Server IP : 51.89.169.208 / Your IP : 18.118.27.44 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/share/doc/perl-Test-Simple/t/Legacy/Regression/ |
Upload File : |
use strict; use warnings; # HARNESS-NO-STREAM use Test2::Util qw/CAN_THREAD/; BEGIN { unless(CAN_THREAD) { print "1..0 # Skip threads are not supported.\n"; exit 0; } } BEGIN { unless ( $ENV{AUTHOR_TESTING} ) { print "1..0 # Skip many perls have broken threads. Enable with AUTHOR_TESTING.\n"; exit 0; } } use Test2::IPC; use threads; use Test::More; plan 'skip_all' => "This test cannot be run with the current formatter" unless Test::Builder->new->{Stack}->top->format->isa('Test::Builder::Formatter'); ok 1 for (1 .. 2); # used to reset the counter after thread finishes my $ct_num = Test::More->builder->current_test; my $subtest_out = async { my $out = ''; #simulate a subtest to not confuse the parent TAP emission my $tb = Test::More->builder; $tb->reset; for (qw/output failure_output todo_output/) { close $tb->$_; open($tb->$_, '>', \$out); } ok 1 for (1 .. 3); done_testing; close $tb->$_ for (qw/output failure_output todo_output/); $out; } ->join; $subtest_out =~ s/^/ /gm; print $subtest_out; # reset as if the thread never "said" anything Test::More->builder->current_test($ct_num); ok 1 for (1 .. 4); done_testing;