Mercurial > hg > octave-lyh
changeset 7645:734854f21c94
fntests.m: report number .m and .cc files without tests separately
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Mar 2008 14:46:48 -0400 |
parents | 91d7440211e7 |
children | ad16ea379d2f |
files | test/ChangeLog test/fntests.m |
diffstat | 2 files changed, 29 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2008-03-26 John W. Eaton <jwe@octave.org> + + * fntests.m (report_files_with_no_tests): New function. + Use it to report number of .m and .cc files without tests separately. + 2008-03-25 John W. Eaton <jwe@octave.org> * test_index-wfi-f.m: New tests.
--- a/test/fntests.m +++ b/test/fntests.m @@ -164,6 +164,23 @@ _assert_printf = ""; endfunction +function n = num_elts_matching_pattern (lst, pat) + n = 0; + for i = 1:length (lst) + if (! isempty (regexp (lst{i}, pat))) + n++; + endif + endfor +endfunction + +function report_files_with_no_tests (with, without, typ) + pat = cstrcat ("\\", typ, "$"); + n_with = num_elts_matching_pattern (with, pat); + n_without = num_elts_matching_pattern (without, pat); + n_tot = n_with + n_without; + printf ("\n%d (of %d) %s files have no tests.\n", n_without, n_tot, typ); +endfunction + pso = page_screen_output (); warn_state = warning ("query", "quiet"); warning ("on", "quiet"); @@ -214,14 +231,16 @@ printf ("was built\n"); endif - n_files_with_no_tests = length (files_with_no_tests); - n_files = n_files_with_no_tests + length (files_with_tests); - printf ("\n%d (of %d) files have no tests. Please help improve Octave by\n", - n_files_with_no_tests, n_files); - printf ("contributing tests for these files (see the list in the file fntests.log).\n"); + report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m"); + report_files_with_no_tests (files_with_tests, files_with_no_tests, ".cc"); + + printf ("\nPlease help improve Octave by contributing tests for"); + printf ("these files (see the list in the file fntests.log).\n"); + fprintf (fid, "\nFiles with no tests:\n\n%s", list_in_columns (files_with_no_tests, 80)); fclose (fid); + page_screen_output (pso); warning (warn_state.state, "quiet"); catch