summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-02-03 20:17:50 -0500
committerdoy <doy@tozt.net>2009-02-03 20:17:50 -0500
commitdb35dd17e7c9268ca5300b3a475cf93f1f70f04c (patch)
tree238cd8d7c9cd03d48022fd5df375122c83e7fa69
parent6b0de765461e3592e0fd2a88051eeadaac516158 (diff)
downloadio-pty-easy-db35dd17e7c9268ca5300b3a475cf93f1f70f04c.tar.gz
io-pty-easy-db35dd17e7c9268ca5300b3a475cf93f1f70f04c.zip
make test 004 timeout rather than hanging on systems where it's broken
-rw-r--r--t/004-undefined-program.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/004-undefined-program.t b/t/004-undefined-program.t
index 8ecf475..5b398c6 100644
--- a/t/004-undefined-program.t
+++ b/t/004-undefined-program.t
@@ -5,6 +5,11 @@ use Test::More tests => 2;
use IO::Pty::Easy;
my $pty = new IO::Pty::Easy;
-eval { $pty->spawn("missing_program_io_pty_easy") };
+eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ alarm 5;
+ $pty->spawn("missing_program_io_pty_easy");
+ alarm 0;
+};
like($@, qr/Cannot exec\(missing_program_io_pty_easy\)/);
ok(!$pty->is_active, "pty isn't active if program doesn't exist");