Expand command line test globs on Win32.
[p5sagit/p5-mst-13.2.git] / ext / threads / shared / t / no_share.t
CommitLineData
dab065ea 1
2
3
4
5BEGIN {
6# chdir 't' if -d 't';
7# push @INC ,'../lib';
8 require Config; import Config;
9 unless ($Config{'useithreads'}) {
10 print "1..0 # Skip: no useithreads\n";
11 exit 0;
12 }
13 $SIG{__WARN__} = sub { $warnmsg = shift; };
14}
15
16
17sub ok {
18 my ($id, $ok, $name) = @_;
19
20 # You have to do it this way or VMS will get confused.
21 print $ok ? "ok $id - $name\n" : "not ok $id - $name\n";
22
23 printf "# Failed test at line %d\n", (caller)[2] unless $ok;
24
25 return $ok;
26}
27
28our $warnmsg;
29use ExtUtils::testlib;
30use strict;
31BEGIN { print "1..5\n" };
32use threads::shared;
33use threads;
34ok(1,1,"loaded");
35ok(2,$warnmsg =~ /Warning, threads::shared has already been loaded/,
36 "threads has warned us");
37my $test = "bar";
38share($test);
39ok(3,$test eq "bar","Test disabled share not interfering");
40threads->create(
41 sub {
42 ok(4,$test eq "bar","Test disabled share after thread");
43 $test = "baz";
44 })->join();
45ok(5,$test eq "bar","Test that value hasn't changed in another thread");
46
47