Mercurial > octave
changeset 33100:71bbf3d89efe stable
display total time to execute test suite
* __run_test_suite__.m (__run_test_suite__): Also track and display
total CPU and wall-clock time.
(print_pass_fail): Use ID to pair tic and toc calls.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 27 Feb 2024 23:48:37 -0500 |
parents | 55c8c338aaeb |
children | 0cee23f74ae9 f3c6badd9dd4 |
files | scripts/testfun/__run_test_suite__.m |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/testfun/__run_test_suite__.m Tue Feb 27 16:40:49 2024 -0500 +++ b/scripts/testfun/__run_test_suite__.m Tue Feb 27 23:48:37 2024 -0500 @@ -68,6 +68,8 @@ if (fid < 0) error ("__run_test_suite__: could not open %s for writing", logfile); endif + tot_cpu_tm = cputime (); + tot_tic_tag = tic (); test ("", "explain", fid); puts ("\nIntegrated test scripts:\n\n"); printf ("%101s\n", "[ CPU / CLOCK ]"); @@ -92,6 +94,9 @@ drtsk += rtsk; drgrs += rgrs; endfor + tot_clock_tm = toc (tot_tic_tag); + tot_cpu_tm = cputime () - tot_cpu_tm; + printf ("%80s [%6.1fs / %6.1fs]", "total time (CPU / CLOCK)", tot_cpu_tm, tot_clock_tm); if (! isempty (summary_failure_info)) puts ("\nFailure Summary:\n\n"); for i = 1:numel (summary_failure_info) @@ -215,9 +220,9 @@ tmp = reduce_test_file_name (ffnm, topbuilddir, topsrcdir); print_test_file_name (tmp); cpu_tm = cputime (); - tic (); + tic_tag = tic (); [p, n, xf, xb, sk, rtsk, rgrs] = test (ffnm, "quiet", fid); - clock_tm = toc (); + clock_tm = toc (tic_tag); cpu_tm = cputime () - cpu_tm; print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs, cpu_tm, clock_tm); dp += p;