X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=NPTest.pm;h=54a535e77808b167741ba30ca744fcb3266acc5c;hb=a179737771ece982e1840d480b10cb6ed1792619;hp=672cb99c6c807ebda1ffaca604b0230f08bb4ee9;hpb=299c6bab02f4a2068a7ba8bdfefc6c155f7d7364;p=nagiosplug.git diff --git a/NPTest.pm b/NPTest.pm index 672cb99..54a535e 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -21,7 +21,7 @@ use Data::Dumper; use Test; use vars qw($VERSION); -$VERSION = do { my @r = (q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker +$VERSION = "1556."; # must be all one line, for MakeMaker =head1 NAME @@ -57,10 +57,10 @@ If a parameter needs to be entered and the test is run without a tty 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 @@ -625,10 +625,10 @@ sub testCmd { chomp $output; $object->output($output); + my ($pkg, $file, $line) = caller(0); + print "Testing: $command", $/; if ($ENV{'NPTEST_DEBUG'}) { - my ($pkg, $file, $line) = caller(0); print "testCmd: Called from line $line in $file", $/; - print "Testing: $command", $/; print "Output: ", $object->output, $/; print "Return code: ", $object->return_code, $/; }