6 if (! $Config{'useithreads'}) {
7 print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
12 use ExtUtils::testlib;
15 my ($id, $ok, $name) = @_;
17 # You have to do it this way or VMS will get confused.
19 print("ok $id - $name\n");
21 print("not ok $id - $name\n");
22 printf("# Failed test at line %d\n", (caller)[2]);
30 print("1..6\n"); ### Number of tests that will be run ###
35 $SIG{__WARN__} = sub { $warnmsg = shift; };
42 ### Start of Testing ###
44 ok(2, ($warnmsg =~ /Warning, threads::shared has already been loaded/)?1:0,
45 "threads has warned us");
49 ok(3, $test eq "bar", "Test disabled share not interfering");
52 ok(4, $test eq "bar", "Test disabled share after thread");
55 # Value should either remain unchanged or be value set by other thread
56 ok(5, $test eq "bar" || $test eq 'baz', "Test that value is an expected one");
58 ok(6, ! is_shared($test), "Check for sharing");