# HG changeset patch # User John W. Eaton # Date 1206557208 14400 # Node ID 734854f21c94bd4d50999717a725e33b5178e94b # Parent 91d7440211e78e428ecf076e0ef3ffd17656cbdc fntests.m: report number .m and .cc files without tests separately diff -r 91d7440211e7 -r 734854f21c94 test/ChangeLog --- a/test/ChangeLog Wed Mar 26 12:56:51 2008 -0400 +++ b/test/ChangeLog Wed Mar 26 14:46:48 2008 -0400 @@ -1,3 +1,8 @@ +2008-03-26 John W. Eaton + + * 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 * test_index-wfi-f.m: New tests. diff -r 91d7440211e7 -r 734854f21c94 test/fntests.m --- a/test/fntests.m Wed Mar 26 12:56:51 2008 -0400 +++ b/test/fntests.m Wed Mar 26 14:46:48 2008 -0400 @@ -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