changeset 32900:af3d1dec5e5d

maint: merge stable to default
author John W. Eaton <jwe@octave.org>
date Thu, 01 Feb 2024 13:28:57 -0500
parents 212bb363f1fa (current diff) 4d24afc1d32b (diff)
children f4d7e6efb2e9 9aeb66a38955
files
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/testfun/__run_test_suite__.m	Thu Feb 01 01:24:59 2024 -0500
+++ b/scripts/testfun/__run_test_suite__.m	Thu Feb 01 13:28:57 2024 -0500
@@ -70,6 +70,7 @@
       endif
       test ("", "explain", fid);
       puts ("\nIntegrated test scripts:\n\n");
+      printf ("%101s\n", "[ CPU    /  CLOCK ]");
       for i = 1:length (fcndirs)
         [p, n, xf, xb, sk, rtsk, rgrs] = run_test_dir (fid, fcndirs{i}, false);
         dp += p;
@@ -213,8 +214,12 @@
           if (has_tests (ffnm))
             tmp = reduce_test_file_name (ffnm, topbuilddir, topsrcdir);
             print_test_file_name (tmp);
+            cpu_tm = cputime ();
+            tic ();
             [p, n, xf, xb, sk, rtsk, rgrs] = test (ffnm, "quiet", fid);
-            print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs);
+            clock_tm = toc ();
+            cpu_tm = cputime () - cpu_tm;
+            print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs, cpu_tm, clock_tm);
             dp += p;
             dn += n;
             dxf += xf;
@@ -256,11 +261,11 @@
 
 endfunction
 
-function fail_info = print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs)
+function fail_info = print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs, cpu_tm, clock_tm)
 
   if (nargin == 1)
     ## The summary info struct just contains info about failures, not
-    ## skipped tests.
+    ## skipped tests or timings.
     info = p;
     p = info.pass;
     n = info.ntst;
@@ -269,10 +274,15 @@
     sk = 0;
     rtsk = 0;
     rgrs = info.rgrs;
+    cpu_tm = 0;
+    clock_tm = 0;
   endif
 
   if ((n + sk + rtsk + rgrs) > 0)
     printf (" pass %4d/%-4d", p, n);
+    if (cpu_tm != 0 || clock_tm != 0)
+      printf (" [%6.3fs / %6.3fs]", cpu_tm, clock_tm);
+    endif
     nfail = n - p - xf - xb - rgrs;
     if (nfail > 0)
       printf ("\n%72s %3d", "FAIL ", nfail);