aboutsummaryrefslogtreecommitdiff
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 {
}
sub testCmd {
- my $class = shift;
+ my $class = shift;
my $command = shift or die "No command passed to testCmd";
+ my $timeout = shift || 120;
my $object = $class->new;
local $SIG{'ALRM'} = sub { die("timeout in command: $command"); };
- alarm(120); # no test should take longer than 120 seconds
+ alarm($timeout); # no test should take longer than 120 seconds
my $output = `$command`;
$object->return_code($? >> 8);