# HG changeset patch # User John W. Eaton # Date 1630595865 14400 # Node ID 4fa7200f230a27190cd367e6c61c8190a49f6dcd # Parent b08749cb3261f64e6b477ebd1c740b9a792e13c8 * __run_test_suite__.m: Show summary of failed tests before final summary. diff -r b08749cb3261 -r 4fa7200f230a scripts/testfun/__run_test_suite__.m --- a/scripts/testfun/__run_test_suite__.m Wed Sep 01 23:53:27 2021 -0400 +++ b/scripts/testfun/__run_test_suite__.m Thu Sep 02 11:17:45 2021 -0400 @@ -42,6 +42,7 @@ endif files_with_no_tests = {}; files_with_tests = {}; + summary_failure_info = struct ([]); ## FIXME: These names don't really make sense if we are running ## tests for an installed copy of Octave. if (isempty (topsrcdir)) @@ -90,6 +91,14 @@ drtsk += rtsk; drgrs += rgrs; endfor + if (! isempty (summary_failure_info)) + puts ("\nFailure Summary:\n\n"); + for i = 1:numel (summary_failure_info) + info = summary_failure_info(i); + print_test_file_name (info.name); + print_pass_fail (info); + endfor + endif puts ("\nSummary:\n\n"); nfail = dn - dp - dxf - dxb - drgrs; printf (" %-30s %6d\n", "PASS", dp); @@ -214,6 +223,13 @@ drtsk += rtsk; drgrs += rgrs; files_with_tests(end+1) = ffnm; + if (n - p > 0) + ## Save info for summary if there were any failed + ## tests for this file. + failure_info = struct ("name", tmp, "pass", p, "ntst", n, + "xf", xf, "xb", xb, "rgrs", rgrs); + summary_failure_info(end+1) = failure_info; + endif else ## To reduce the list length, only mark .cc files that contain ## DEFUN definitions. @@ -238,7 +254,20 @@ printf (" %s %s", nm, filler); endfunction -function print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs) +function fail_info = print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs) + + if (nargin == 1) + ## The summary info struct just contains info about failures, not + ## skipped tests. + info = p; + p = info.pass; + n = info.ntst; + xf = info.xf; + xb = info.xb; + sk = 0; + rtsk = 0; + rgrs = info.rgrs; + endif if ((n + sk + rtsk + rgrs) > 0) printf (" pass %4d/%-4d", p, n);