diff --git a/NPTest.pm b/NPTest.pm
index 1372d1423042bcaf0357f77367679cd6ccf08aad..d4542ddc2cc5348c4b41a1b13b3e879b6e53be30 100644 (file)
--- a/NPTest.pm
+++ b/NPTest.pm
which will then be returned as "" for the test to skip if appropriate.
If a parameter needs to be entered and the test is run without a tty
-attached (such as a cronjob), this routine will die causing the test to
-fail.
+attached (such as a cronjob), the parameter will be assigned as if it
+was "none". Tests can check for the parameter and skip if not set.
-Responses are stored in an external, file-based
-cache so subsequent test runs will use these values. The user is able
-to change the values by amending the values in the file /var/tmp/NPTest.pm,
-or by setting the appropriate environment variable before running the test.
+Responses are stored in an external, file-based cache so subsequent test
+runs will use these values. The user is able to change the values by
+amending the values in the file /var/tmp/NPTest.cache, or by setting
+the appropriate environment variable before running the test.
The option exists to store parameters in a scoped means, allowing a
test harness to a localise a parameter should the need arise. This
return $default;
}
- die "Need to manually enter test parameter $param" unless (-t STDERR);
+ # Set "none" if no terminal attached (eg, tinderbox build servers when new variables set)
+ return "" unless (-t STDERR);
my $userResponse = "";
return $1 || "";
}
+sub only_output {
+ my $self = shift;
+ $_ = $self->{output};
+ /(.*?)\|/;
+ return $1 || "";
+}
+
sub testCmd {
my $class = shift;
my $command = shift or die "No command passed to testCmd";