Skip to content

Commit

Permalink
Added new option –with-txt to runtests.pl
Browse files Browse the repository at this point in the history
This option generates a txt log (failed.log) containing the summary of
all failed tests.
  • Loading branch information
lochel committed Aug 5, 2015
1 parent e022a1f commit befd014
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions partest/runtests.pl
Expand Up @@ -59,6 +59,7 @@
my $check_proc_cpu = 1;
my $withxml = 0;
my $withxmlcmd = 0;
my $withtxt = 0;
my $have_dwdiff = "";

{
Expand Down Expand Up @@ -90,6 +91,7 @@
print(" -nocolour Don't use colours in output.\n");
print(" -counttests Don't run the test; only count them.\n");
print(" -with-xml Output XML log.\n");
print(" -with-txt Output TXT log.\n");
print(" -failing Run failing tests instead of working.\n");
print(" -veryfew Run only a very small number of tests to see if runtests.pl is working.\n");
print(" -gitlibs If you have installed omc using GITLIBRARIES=Yes, you can test some of those libraries.\n");
Expand Down Expand Up @@ -127,6 +129,9 @@
$withxml = 1;
$withxmlcmd = '-with-xml';
}
elsif(/^-with-txt$/) {
$withtxt = 1;
}
elsif(/^-failing$/) {
$run_failing = 1;
}
Expand Down Expand Up @@ -357,6 +362,20 @@ sub run_tests {
foreach my $failed_test (@sorted) {
print "\t" . $failed_test . "\n";
}

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;
}
}

if ($slowest) {
Expand Down

0 comments on commit befd014

Please sign in to comment.