Commit 4b642caf1114f6a354c21444d1fdccba3cb894b9

Authored by Jay Berkenbilt
1 parent 4c7cfd5c

Update qtest-driver to log invalid tests

This is taken from an unrelased change to qtest.
Showing 2 changed files with 14 additions and 2 deletions
@@ -4,6 +4,7 @@ Next @@ -4,6 +4,7 @@ Next
4 4
5 * At next release, hide release-qpdf-10.6.3.0cmake* versions at readthedocs 5 * At next release, hide release-qpdf-10.6.3.0cmake* versions at readthedocs
6 * Stay on top of https://github.com/pikepdf/pikepdf/pull/315 6 * Stay on top of https://github.com/pikepdf/pikepdf/pull/315
  7 +* Release qtest with updates to qtest-driver and copy back into qpdf
7 8
8 In order: 9 In order:
9 * json v2 10 * json v2
qtest/bin/qtest-driver
@@ -218,6 +218,7 @@ if (defined $tc_log) @@ -218,6 +218,7 @@ if (defined $tc_log)
218 print_xml(">\n"); 218 print_xml(">\n");
219 print_junit("<?xml version=\"1.0\"?>\n" . 219 print_junit("<?xml version=\"1.0\"?>\n" .
220 "<testsuites>\n"); 220 "<testsuites>\n");
  221 +my @invalid_test_suites = ();
221 foreach my $test (@tests) 222 foreach my $test (@tests)
222 { 223 {
223 print_and_log("\nRunning $test\n"); 224 print_and_log("\nRunning $test\n");
@@ -226,7 +227,8 @@ foreach my $test (@tests) @@ -226,7 +227,8 @@ foreach my $test (@tests)
226 my @results = run_test($test); 227 my @results = run_test($test);
227 if (scalar(@results) != 5) 228 if (scalar(@results) != 5)
228 { 229 {
229 - error("test driver $test returned invalid results"); 230 + print_and_log("test driver $test returned invalid results\n");
  231 + push(@invalid_test_suites, $test);
230 } 232 }
231 else 233 else
232 { 234 {
@@ -282,7 +284,7 @@ tc_do_final_checks(); @@ -282,7 +284,7 @@ tc_do_final_checks();
282 284
283 my $okay = ((($totpasses + $totxfails) == $tottests) && 285 my $okay = ((($totpasses + $totxfails) == $tottests) &&
284 ($errors == 0) && ($totmissing == 0) && ($totextra == 0) && 286 ($errors == 0) && ($totmissing == 0) && ($totextra == 0) &&
285 - ($coverage_okay)); 287 + ($coverage_okay) && (scalar(@invalid_test_suites) == 0));
286 288
287 print "\n"; 289 print "\n";
288 print_and_pad("Overall test suite"); 290 print_and_pad("Overall test suite");
@@ -299,6 +301,15 @@ else @@ -299,6 +301,15 @@ else
299 } 301 }
300 302
301 my $summary = "\nTESTS COMPLETE. Summary:\n\n"; 303 my $summary = "\nTESTS COMPLETE. Summary:\n\n";
  304 +if (@invalid_test_suites)
  305 +{
  306 + $summary .= "INVALID TEST SUITES:\n";
  307 + foreach my $t (@invalid_test_suites)
  308 + {
  309 + $summary .= " $t\n";
  310 + }
  311 + $summary .= "\n";
  312 +}
302 $summary .= 313 $summary .=
303 sprintf("Total tests: %d\n" . 314 sprintf("Total tests: %d\n" .
304 "Passes: %d\n" . 315 "Passes: %d\n" .