From: Steve Hay Date: Fri, 27 May 2005 16:15:41 +0000 (+0000) Subject: Skip signals and core dump tests on Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c5be41ca584ca84b007976e40b3e32e6829bc3f;p=p5sagit%2Fp5-mst-13.2.git Skip signals and core dump tests on Win32 See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-05/msg00749.html p4raw-id: //depot/perl@24606 --- diff --git a/t/run/exit.t b/t/run/exit.t index ef39e04..5075b93 100644 --- a/t/run/exit.t +++ b/t/run/exit.t @@ -32,29 +32,36 @@ is( ${^CHILD_ERROR_NATIVE}, 0, 'Normal exit ${^CHILD_ERROR_NATIVE}' ); if ($^O ne 'VMS') { my $posix_ok = eval { require POSIX; }; + my $wait_macros_ok = defined &POSIX::WIFEXITED; $exit = run('exit 42'); is( $exit >> 8, 42, 'Non-zero exit' ); is( $exit, $?, 'Non-zero exit $?' ); isnt( !${^CHILD_ERROR_NATIVE}, 0, 'Non-zero exit ${^CHILD_ERROR_NATIVE}' ); - SKIP: { - skip("No POSIX", 3) unless $posix_ok; - ok(POSIX::WIFEXITED(${^CHILD_ERROR_NATIVE}), "WIFEXITED"); - ok(!POSIX::WIFSIGNALED(${^CHILD_ERROR_NATIVE}), "WIFSIGNALED"); - is(POSIX::WEXITSTATUS(${^CHILD_ERROR_NATIVE}), 42, "WEXITSTATUS"); + SKIP: { + skip("No POSIX", 3) unless $posix_ok; + skip("No POSIX wait macros", 3) unless $wait_macros_ok; + ok(POSIX::WIFEXITED(${^CHILD_ERROR_NATIVE}), "WIFEXITED"); + ok(!POSIX::WIFSIGNALED(${^CHILD_ERROR_NATIVE}), "WIFSIGNALED"); + is(POSIX::WEXITSTATUS(${^CHILD_ERROR_NATIVE}), 42, "WEXITSTATUS"); } - $exit = run('kill 15, $$; sleep(1);'); + SKIP: { + skip("Skip signals and core dump tests on Win32", 7) if $^O eq 'MSWin32'; + + $exit = run('kill 15, $$; sleep(1);'); - is( $exit & 127, 15, 'Term by signal' ); - ok( !($exit & 128), 'No core dump' ); - is( $? & 127, 15, 'Term by signal $?' ); - isnt( ${^CHILD_ERROR_NATIVE}, 0, 'Term by signal ${^CHILD_ERROR_NATIVE}' ); - SKIP: { + is( $exit & 127, 15, 'Term by signal' ); + ok( !($exit & 128), 'No core dump' ); + is( $? & 127, 15, 'Term by signal $?' ); + isnt( ${^CHILD_ERROR_NATIVE}, 0, 'Term by signal ${^CHILD_ERROR_NATIVE}' ); + SKIP: { skip("No POSIX", 3) unless $posix_ok; + skip("No POSIX wait macros", 3) unless $wait_macros_ok; ok(!POSIX::WIFEXITED(${^CHILD_ERROR_NATIVE}), "WIFEXITED"); ok(POSIX::WIFSIGNALED(${^CHILD_ERROR_NATIVE}), "WIFSIGNALED"); is(POSIX::WTERMSIG(${^CHILD_ERROR_NATIVE}), 15, "WTERMSIG"); + } } } else {