[Box Backup-commit] COMMIT r1949 - box/chris/general
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sat, 8 Dec 2007 21:46:53 +0000 (UTC)
Author: chris
Date: 2007-12-08 21:46:53 +0000 (Sat, 08 Dec 2007)
New Revision: 1949
Modified:
box/chris/general/runtest.pl.in
Log:
Log stderr output in the test log file, and don't delete it at the
end of the test. It might be useful later, and will be overwritten
automatically next run.
Keep each test's log in a separate file for later review.
(merges [1904], [1907])
Modified: box/chris/general/runtest.pl.in
===================================================================
--- box/chris/general/runtest.pl.in 2007-12-08 21:45:06 UTC (rev 1948)
+++ box/chris/general/runtest.pl.in 2007-12-08 21:46:53 UTC (rev 1949)
@@ -86,12 +86,15 @@
$exit_code = 2;
return;
}
+
+ my $logfile = "test-$t.log";
# run it
- my $test_res = system("cd $test_mode/test/$t ; ./t | tee ../../../temp.runtest");
+ my $test_res = system("cd $test_mode/test/$t ; ./t 2>&1 " .
+ "| tee ../../../$logfile");
# open test results
- if(open RESULTS,'temp.runtest')
+ if(open RESULTS, $logfile)
{
my $last;
while(<RESULTS>)
@@ -101,7 +104,7 @@
close RESULTS;
chomp $last;
- push @results,"$t: $last";
+ push @results, "$t: $last";
if ($last ne "PASSED")
{
@@ -110,10 +113,11 @@
}
else
{
- push @results,"$t: output not found";
+ push @results,
+ "$t: failed to open test log file: $logfile: $!";
}
# delete test results
- unlink 'temp.runtest';
+ # unlink $logfile;
}