comparison test/fntests.m @ 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 11c781ef004a
children 9c24ca8761f7
comparison
equal deleted inserted replaced
7644:91d7440211e7 7645:734854f21c94
162 ret = strcmp (_assert_printf, str); 162 ret = strcmp (_assert_printf, str);
163 endif 163 endif
164 _assert_printf = ""; 164 _assert_printf = "";
165 endfunction 165 endfunction
166 166
167 function n = num_elts_matching_pattern (lst, pat)
168 n = 0;
169 for i = 1:length (lst)
170 if (! isempty (regexp (lst{i}, pat)))
171 n++;
172 endif
173 endfor
174 endfunction
175
176 function report_files_with_no_tests (with, without, typ)
177 pat = cstrcat ("\\", typ, "$");
178 n_with = num_elts_matching_pattern (with, pat);
179 n_without = num_elts_matching_pattern (without, pat);
180 n_tot = n_with + n_without;
181 printf ("\n%d (of %d) %s files have no tests.\n", n_without, n_tot, typ);
182 endfunction
183
167 pso = page_screen_output (); 184 pso = page_screen_output ();
168 warn_state = warning ("query", "quiet"); 185 warn_state = warning ("query", "quiet");
169 warning ("on", "quiet"); 186 warning ("on", "quiet");
170 try 187 try
171 page_screen_output (0); 188 page_screen_output (0);
212 printf ("Skipped tests are features that are disabled in this version\n"); 229 printf ("Skipped tests are features that are disabled in this version\n");
213 printf ("of Octave as the needed libraries were not present when Octave\n"); 230 printf ("of Octave as the needed libraries were not present when Octave\n");
214 printf ("was built\n"); 231 printf ("was built\n");
215 endif 232 endif
216 233
217 n_files_with_no_tests = length (files_with_no_tests); 234 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m");
218 n_files = n_files_with_no_tests + length (files_with_tests); 235 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".cc");
219 printf ("\n%d (of %d) files have no tests. Please help improve Octave by\n", 236
220 n_files_with_no_tests, n_files); 237 printf ("\nPlease help improve Octave by contributing tests for");
221 printf ("contributing tests for these files (see the list in the file fntests.log).\n"); 238 printf ("these files (see the list in the file fntests.log).\n");
239
222 fprintf (fid, "\nFiles with no tests:\n\n%s", 240 fprintf (fid, "\nFiles with no tests:\n\n%s",
223 list_in_columns (files_with_no_tests, 80)); 241 list_in_columns (files_with_no_tests, 80));
224 fclose (fid); 242 fclose (fid);
243
225 page_screen_output (pso); 244 page_screen_output (pso);
226 warning (warn_state.state, "quiet"); 245 warning (warn_state.state, "quiet");
227 catch 246 catch
228 page_screen_output (pso); 247 page_screen_output (pso);
229 warning (warn_state.state, "quiet"); 248 warning (warn_state.state, "quiet");