X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=t%2F09-load-threads.t;h=0825b27b1e13e7468e0599f78e39b3e379b53281;hp=91092b0889df9b4804c11cb96772d21609ca976d;hb=be3665d8224dfbb9cff5f53796500821d9c8185a;hpb=432cd8420b1c4c1d963efd13695497095fde9bd0 diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 91092b0..0825b27 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 'run_perl'; - my ($module, $thread_safe_var); BEGIN { $module = 'Variable::Magic'; @@ -27,29 +24,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';