summaryrefslogtreecommitdiffstats
path: root/NPTest.pm
diff options
context:
space:
mode:
Diffstat (limited to 'NPTest.pm')
-rw-r--r--NPTest.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/NPTest.pm b/NPTest.pm
index 2baed0b0..e04ebba3 100644
--- a/NPTest.pm
+++ b/NPTest.pm
@@ -627,12 +627,13 @@ sub only_output {
627} 627}
628 628
629sub testCmd { 629sub testCmd {
630 my $class = shift; 630 my $class = shift;
631 my $command = shift or die "No command passed to testCmd"; 631 my $command = shift or die "No command passed to testCmd";
632 my $timeout = shift || 120;
632 my $object = $class->new; 633 my $object = $class->new;
633 634
634 local $SIG{'ALRM'} = sub { die("timeout in command: $command"); }; 635 local $SIG{'ALRM'} = sub { die("timeout in command: $command"); };
635 alarm(120); # no test should take longer than 120 seconds 636 alarm($timeout); # no test should take longer than 120 seconds
636 637
637 my $output = `$command`; 638 my $output = `$command`;
638 $object->return_code($? >> 8); 639 $object->return_code($? >> 8);