X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F09-load-threads.t;h=10aef241624ca3cd3e84706d9494d4bb2e313357;hb=515346d5652e6f39bd6329463e4b0245d5368902;hp=3bd92f9b667bdfcfdc070669cb44d6f48e321a82;hpb=7f24c0f5e913f78df408f9c70f6559d42a116c90;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 3bd92f9..10aef24 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -38,12 +38,14 @@ BEGIN { if (defined $thread_safe_var) { my $stat = run_perl "require POSIX; require $module; exit($thread_safe_var ? POSIX::EXIT_SUCCESS() : POSIX::EXIT_FAILURE())"; - require POSIX; - my $res = $stat >> 8; - if ($res == POSIX::EXIT_SUCCESS()) { - $is_threadsafe = 1; - } elsif ($res == POSIX::EXIT_FAILURE()) { - $is_threadsafe = !1; + if (defined $stat) { + require POSIX; + my $res = $stat >> 8; + if ($res == POSIX::EXIT_SUCCESS()) { + $is_threadsafe = 1; + } elsif ($res == POSIX::EXIT_FAILURE()) { + $is_threadsafe = !1; + } } if (not defined $is_threadsafe) { skip_all "Could not detect if $module is thread safe or not"; @@ -57,7 +59,7 @@ BEGIN { my $could_not_create_thread = 'Could not create thread'; -use Test::Leaner tests => 1 + (2 + 2 * 2) + 6 + (1 + 2 * 4); +use Test::Leaner tests => 1 + (2 + 2 * 2) + 6 + (2 * 4) + 2; sub is_loaded { my ($affirmative, $desc) = @_; @@ -252,3 +254,6 @@ SKIP: { } is_loaded 0, 'main body, after simultaneous threads'; + +do_load; +is_loaded 1, 'main body, loaded at end';