From db35dd17e7c9268ca5300b3a475cf93f1f70f04c Mon Sep 17 00:00:00 2001 From: doy Date: Tue, 3 Feb 2009 20:17:50 -0500 Subject: make test 004 timeout rather than hanging on systems where it's broken --- t/004-undefined-program.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3