Update qtest-driver to log invalid tests

This is taken from an unrelased change to qtest.
This commit is contained in:
Jay Berkenbilt 2022-05-14 11:40:24 -04:00
parent 4c7cfd5cbc
commit 4b642caf11
2 changed files with 14 additions and 2 deletions

1
TODO
View File

@ -4,6 +4,7 @@ Next
* At next release, hide release-qpdf-10.6.3.0cmake* versions at readthedocs
* Stay on top of https://github.com/pikepdf/pikepdf/pull/315
* Release qtest with updates to qtest-driver and copy back into qpdf
In order:
* json v2

View File

@ -218,6 +218,7 @@ if (defined $tc_log)
print_xml(">\n");
print_junit("<?xml version=\"1.0\"?>\n" .
"<testsuites>\n");
my @invalid_test_suites = ();
foreach my $test (@tests)
{
print_and_log("\nRunning $test\n");
@ -226,7 +227,8 @@ foreach my $test (@tests)
my @results = run_test($test);
if (scalar(@results) != 5)
{
error("test driver $test returned invalid results");
print_and_log("test driver $test returned invalid results\n");
push(@invalid_test_suites, $test);
}
else
{
@ -282,7 +284,7 @@ tc_do_final_checks();
my $okay = ((($totpasses + $totxfails) == $tottests) &&
($errors == 0) && ($totmissing == 0) && ($totextra == 0) &&
($coverage_okay));
($coverage_okay) && (scalar(@invalid_test_suites) == 0));
print "\n";
print_and_pad("Overall test suite");
@ -299,6 +301,15 @@ else
}
my $summary = "\nTESTS COMPLETE. Summary:\n\n";
if (@invalid_test_suites)
{
$summary .= "INVALID TEST SUITES:\n";
foreach my $t (@invalid_test_suites)
{
$summary .= " $t\n";
}
$summary .= "\n";
}
$summary .=
sprintf("Total tests: %d\n" .
"Passes: %d\n" .