Mercurial > octave
changeset 24480:04d1a3ea26a3
runtests.m: Update printing of output.
test.m was modified to report new failure classes (known bug, regression),
but runtests.m was never updated.
* runtests.m (run_all_tests): Call test() and collect additional outputs.
* runtests.m (has_tests): Copy same function from __run_test_suite__.
* runtests.m (print_pass_fail): Copy same function from __run_test_suite__.
* runtests.m (print_test_file_name): Copy same function from
__run_test_suite__.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 27 Dec 2017 16:28:46 -0800 |
parents | 6d2dc40a7c00 |
children | 6b685bb172c6 |
files | scripts/testfun/runtests.m |
diffstat | 1 files changed, 26 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/testfun/runtests.m Wed Dec 27 15:51:48 2017 -0800 +++ b/scripts/testfun/runtests.m Wed Dec 27 16:28:46 2017 -0800 @@ -75,8 +75,8 @@ ff = fullfile (directory, f); if (has_tests (ff)) print_test_file_name (f); - [p, n, xf, sk] = test (ff, "quiet"); - print_pass_fail (n, p, xf); + [p, n, xf, xb, sk, rtsk, rgrs] = test (ff, "quiet"); + print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs); fflush (stdout); elseif (has_functions (ff)) no_tests(end+1) = f; @@ -132,22 +132,34 @@ str = fread (fid, "*char").'; fclose (fid); - retval = ! isempty (regexp (str, '^%!(?:test|xtest|assert|error|warning)', - 'lineanchors', 'once')); + retval = ! isempty (regexp (str, + '^%!(assert|error|fail|test|xtest|warning)', + 'lineanchors', 'once')); endfunction -function print_pass_fail (n, p, xf) +function print_pass_fail (p, n, xf, xb, sk, rtsk, rgrs) - if (n > 0) - printf (" PASS %4d/%-4d", p, n); - nfail = n - p; + if ((n + sk + rtsk + rgrs) > 0) + printf (" PASS %4d/%-4d", p, n); + nfail = n - p - xf - xb - rgrs; if (nfail > 0) - if (nfail != xf) - printf (" FAIL %d", nfail - xf); - else - printf (" XFAIL %d", xf); - endif + printf ("\n%71s %3d", "FAIL ", nfail); + endif + if (rgrs > 0) + printf ("\n%71s %3d", "REGRESSION", rgrs); + endif + if (sk > 0) + printf ("\n%71s %3d", "(missing feature) SKIP ", sk); + endif + if (rtsk > 0) + printf ("\n%71s %3d", "(run-time condition) SKIP ", rtsk); + endif + if (xb > 0) + printf ("\n%71s %3d", "(reported bug) XFAIL", xb); + endif + if (xf > 0) + printf ("\n%71s %3d", "(expected failure) XFAIL", xf); endif endif puts ("\n"); @@ -155,7 +167,7 @@ endfunction function print_test_file_name (nm) - filler = repmat (".", 1, 55-length (nm)); + filler = repmat (".", 1, 60-length (nm)); printf (" %s %s", nm, filler); endfunction