Skip to content

Commit

Permalink
[test] re-enable t/pmc/signal.t
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Nov 23, 2014
1 parent c85a9ed commit de2b6c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions t/pmc/signal.t
@@ -1,5 +1,5 @@
#! perl
# Copyright (C) 2001-2008, Parrot Foundation.
# Copyright (C) 2001-2014, Parrot Foundation.

use strict;
use warnings;
Expand All @@ -25,6 +25,7 @@ Tests signal handling.
# a second problem is to get the test doing the right thing: mainly figuring
# out what PID to kill. The "ps" command isn't one of the portable ones.


my %platforms = map { $_ => 1 } qw/
darwin
hpux
Expand All @@ -33,12 +34,12 @@ my %platforms = map { $_ => 1 } qw/
/;

if ( $platforms{$^O} ) {

#plan tests => 3;
plan skip_all => 'Signals currently disabled';
plan tests => 4;
$ENV{DYLD_LIBRARY_PATH} = "" if $^O eq 'darwin';
#plan skip_all => 'Signals currently disabled';
}
else {
plan skip_all => 'No events yet';
plan skip_all => 'Missing portable getpid hack';
}

#
Expand All @@ -48,7 +49,7 @@ else {
my $pid;

sub parrot_pids {
grep { !/harness/ && !/sh -c/ } `ps axw | grep '[p]arrot'`;
grep { !/harness/ && !/ Z / && !/sh -c/ } `ps axw | grep '[p]arrot'`;
}

sub send_SIGHUP {
Expand Down Expand Up @@ -79,7 +80,7 @@ sub check_running {
select undef, undef, undef, 0.1;
my @ps = parrot_pids;
my $thread = pop @ps;
if ( $thread =~ /^\s*(\d+)/ && $1 == $pid ) {
if ( $thread and $thread =~ /^\s*(\d+)/ and $1 == $pid ) {
ok( 0, "parrot $pid still running" );
}
else {
Expand All @@ -99,12 +100,12 @@ CODE
start
OUTPUT

# check_running;
check_running;

send_SIGHUP;

pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - loop" );
bounds 1 # no JIT
# bounds 1 # no JIT
print "start\n"
# no exception handler - parrot should die silently
Expand Down

0 comments on commit de2b6c6

Please sign in to comment.