#!/usr/bin/perl my $html = 0; # set to 1 to output a nicely formatted HTML page my %toDo=("csv"=>0, "epub"=>0, "html"=>0, "odf"=>0, "raw"=>1, "svg"=>0, "valgrind"=>0 ); my $pass_colour = "11dd11"; my $fail_colour = "dd1111"; my $warn_colour = "e59800"; my $skip_colour = "9999dd"; sub DisplayCell { my ($bgColor, $text) = @_; print "
| File | \n"; print "Call Graph Test | \n"; foreach $i ( @commands ) { print "$listCommand{$i}[0] Diff Test | \n" if ($toDo{$i}); } if (!$toDo{"valgrind"}) { print "Valgrind Tests | \n"; } else { foreach $i ( @commands ) { print "$listCommand{$i}[0] Valgrind Test | \n" if ($toDo{$i});
}
}
print "
| " . $file . " | \n"; } # ////////////////////////// # CALL GRAPH REGRESSION TEST # ////////////////////////// my $cgResult = CgTest("sd2raw --callgraph", $filePath); $callGraphFailures++ if ($cgResult ne "0"); if ($html) { ($cgResult eq "0" ? DisplayCell($pass_colour, "passed") : DisplayCell($fail_colour, "failed")); } else { print "! $file call graph: " . ($cgResult eq "0" ? "passed" : "failed") . "\n"; } # ///////////////////// # DIFF REGRESSION TESTS # ///////////////////// foreach $i ( @commands ) { next if (!$toDo{$i}); $diffFailures{$i}++ if (DiffTest($listCommand{$i}[3], $listCommand{$i}[4], $filePath, $listCommand{$i}[1], ($fileType ~~ $listCommand{$i}[2]) ) eq "fail"); } # //////////////////////// # VALGRIND REGRESSION TEST # //////////////////////// if (!$toDo{"valgrind"}) { if (!$html) { print "! $file valgrind: skipped all tests\n"; } else { DisplayCell($skip_colour, "skipped"); print "