Skip to content

Commit

Permalink
Minor changes to ./runtests.pl -with-txt
Browse files Browse the repository at this point in the history
* Delete always old log file (even if there is no failing test in the
  current run)
* Don't write header and footer to log file
  • Loading branch information
lochel committed Aug 6, 2015
1 parent a2e78b0 commit c7ba372
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions partest/runtests.pl
Expand Up @@ -356,6 +356,10 @@ sub run_tests {
print color 'reset';
print "\n";

if($withtxt) {
unlink("$testsuite_root/failed.log");
}

if(@failed_tests) {
print "\nFailed tests:\n";
my @sorted = sort @failed_tests;
Expand All @@ -364,16 +368,13 @@ sub run_tests {
}

if($withtxt) {
unlink("$testsuite_root/failed.log");
open my $TXTOUT, '>', "$testsuite_root/failed.log" or die "Couldn't open failed.log: $!";
binmode $TXTOUT, ":encoding(UTF-8)";

print $TXTOUT "Failed tests:\n";
foreach my $failed_test (@sorted) {
print $TXTOUT $failed_test . "\n";
}

print $TXTOUT "\n$tests_failed of $test_count failed\n";
close $TXTOUT;
}
}
Expand Down

0 comments on commit c7ba372

Please sign in to comment.