cvsuser 04/10/01 05:06:38
Modified: src events.c
t/pmc signal.t
Log:
enable signal.t on OS X
* PowerBook and linux box now both run 1877 in make test
Revision Changes Path
1.40 +3 -2 parrot/src/events.c
Index: events.c
===================================================================
RCS file: /cvs/public/parrot/src/events.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -w -r1.39 -r1.40
--- events.c 7 May 2004 10:59:16 -0000 1.39
+++ events.c 1 Oct 2004 12:06:37 -0000 1.40
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: events.c,v 1.39 2004/05/07 10:59:16 leo Exp $
+$Id: events.c,v 1.40 2004/10/01 12:06:37 leo Exp $
=head1 NAME
@@ -28,8 +28,9 @@
#define EVENT_DEBUG 0
/*
* not yet - need to sort out platform code and fix exceptions first
+ * TODO get some config for POSIX compliant
*/
-#ifdef linux
+#if defined(linux) || defined(darwin)
# define INSTALL_EVENT_HANDLER 1
#else
# define INSTALL_EVENT_HANDLER 0
1.10 +11 -4 parrot/t/pmc/signal.t
Index: signal.t
===================================================================
RCS file: /cvs/public/parrot/t/pmc/signal.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- signal.t 5 Jul 2004 13:49:39 -0000 1.9
+++ signal.t 1 Oct 2004 12:06:38 -0000 1.10
@@ -1,6 +1,6 @@
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: signal.t,v 1.9 2004/07/05 13:49:39 leo Exp $
+# $Id: signal.t,v 1.10 2004/10/01 12:06:38 leo Exp $
=head1 NAME
@@ -20,7 +20,13 @@
use Test::More;
use strict;
+# actually more platforms should work - all POSIX compliant ones - but
+# signals are currently not enabled for all in src/events.c
+# 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
linux
/;
@@ -41,10 +47,11 @@
sub send_SIGHUP {
$SIG{ALRM} = sub {
# get PID of parrot
- my @ps = `ps -C parrot -o pid`;
+ my @ps = `ps axw | grep [p]arrot`;
die 'no output from ps' unless @ps;
# the IO thread parrot process
- # on 2.2.x there are 4 processes, last is the IO thread
+ # on linux 2.2.x there are 4 processes, last is the IO thread
+ # posix compliant threads have exactly one PID for parrot
my $io_thread = pop @ps;
if ($io_thread =~ /^\s*(\d+)/) {
$pid = $1;
@@ -60,7 +67,7 @@
sub check_running {
select undef, undef, undef, 0.1;
- my @ps = `ps -C parrot -o pid`;
+ my @ps = `ps axw | grep [p]arrot`;
my $thread = pop @ps;
if ($thread =~ /^\s*(\d+)/ && $1 == $pid) {
ok(0, "parrot $pid still running");