11 use VPIT::TestHelpers;
16 'perl on Windows with pseudoforks enabled is required for this test'
17 unless $^O eq 'MSWin32' and $Config::Config{d_pseudofork};
24 plan skip_all => 'could not fork' unless defined $pid;
32 my $immortal = VPIT::TestHelpers::Guard->new(sub { ++$gd });
33 $immortal->{self} = $immortal;
36 eval 'END { ++$local_end }';
38 Thread::Cleanup::register {
39 pass 'pseudo-fork destructor called';
40 is $local_end, 1, 'pseudo-fork destructor called after local END block';
41 is $global_end, 1, 'pseudo-fork destructor called after global END block';
42 is $gd, 0, 'pseudo-fork destructor called before global destruction';