UTF-8 walk errors that become visible in EBCDIC.
[p5sagit/p5-mst-13.2.git] / ext / threads / t / end.t
CommitLineData
4e00007d 1
2BEGIN {
3 chdir 't' if -d 't';
4 @INC = '../lib';
5 require Config; import Config;
6 unless ($Config{'useithreads'}) {
7 print "1..0 # Skip: no useithreads\n";
8 exit 0;
9 }
10}
11
12use ExtUtils::testlib;
13use strict;
14BEGIN { print "1..6\n" };
15use threads;
16use threads::shared;
17
18my $test_id = 1;
19share($test_id);
20use Devel::Peek qw(Dump);
21
22sub ok {
23 my ($ok, $name) = @_;
24
25 # You have to do it this way or VMS will get confused.
26 print $ok ? "ok $test_id - $name\n" : "not ok $test_id - $name\n";
27
28 printf "# Failed test at line %d\n", (caller)[2] unless $ok;
29 $test_id++;
30 return $ok;
31}
32ok(1);
33END { ok(1,"End block run once") }
34threads->create(sub { eval "END { ok(1,'') }"})->join();
35threads->create(sub { eval "END { ok(1,'') }"})->join();
36threads->create(\&thread)->join();
37
38sub thread {
39 eval "END { ok(1,'') }";
40 threads->create(sub { eval "END { ok(1,'') }"})->join();
41}