X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F09-load-threads.t;h=26c061dc49f38ffea5d315222e1f3193c1e79b20;hp=0d474d58d449b74a52468af90f470aee14c7fbc0;hb=8845e141913781c0e0b4b928a38fd23da1752f6b;hpb=44fb7d6a933c6ebd76082e74c60dab5e5a5da50e diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 0d474d5..26c061d 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -3,9 +3,6 @@ use strict; use warnings; -use lib 't/lib'; -use VPIT::TestHelpers; - BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } my ($module, $thread_safe_var); @@ -32,29 +29,8 @@ sub load_test { # Keep the rest of the file untouched -BEGIN { - my $is_threadsafe; - - if (defined $thread_safe_var) { - my $stat = run_perl "require POSIX; require $module; exit($thread_safe_var ? POSIX::EXIT_SUCCESS() : POSIX::EXIT_FAILURE())"; - 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"; - } - } - - VPIT::TestHelpers->import( - threads => [ $module => $is_threadsafe ], - ) -} +use lib 't/lib'; +use VPIT::TestHelpers threads => [ $module, $thread_safe_var ]; my $could_not_create_thread = 'Could not create thread';