Commit | Line | Data |
---|---|---|
1035e7c4 | 1 | use t::threads_check; |
844f2408 | 2 | |
3 | use threads; | |
5197ed54 | 4 | use threads::shared; |
5 | ||
6 | our $had_error :shared; | |
7 | END { $? = $had_error||0 } | |
8 | ||
844f2408 | 9 | use strict; |
5197ed54 | 10 | use warnings; |
844f2408 | 11 | |
9aaf3646 | 12 | BEGIN { |
53daa838 | 13 | if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) { |
b1bee216 | 14 | unshift @INC, sub { |
15 | die 'no XS' if $_[1] eq 'Devel/GlobalDestruction/XS.pm'; | |
16 | }; | |
53daa838 | 17 | } |
9aaf3646 | 18 | } |
19 | ||
5197ed54 | 20 | # load it before spawning a thread, that's the whole point |
21 | require Devel::GlobalDestruction; | |
22 | ||
23 | sub do_test { | |
24 | ||
25 | # just die so we don't need to deal with testcount skew | |
26 | unless ( ($_[0]||'') eq 'arg' ) { | |
27 | $had_error++; | |
28 | die "Argument passing failed!"; | |
29 | } | |
30 | ||
31 | delete $INC{'t/01_basic.t'}; | |
32 | do 't/01_basic.t'; | |
33 | ||
34 | 1; | |
35 | } | |
844f2408 | 36 | |
5197ed54 | 37 | threads->create('do_test', 'arg')->join |
38 | or $had_error++; |