# HG changeset patch # User jwe # Date 1149703884 0 # Node ID 8b4a99ae3b5e7a0f0f279f20f2ff2fc8f8dad58d # Parent 034cdbd34c0aca2a17b3880fe32882d23bc447ea [project @ 2006-06-07 18:11:24 by jwe] diff -r 034cdbd34c0a -r 8b4a99ae3b5e test/ChangeLog --- a/test/ChangeLog Wed Jun 07 15:38:58 2006 +0000 +++ b/test/ChangeLog Wed Jun 07 18:11:24 2006 +0000 @@ -1,3 +1,7 @@ +2006-06-07 John W. Eaton + + * fntests.m: Keep track of files with tests and report total. + 2006-06-01 John W. Eaton * fntests.m (print_test_file_name, print_pass_fail): New functions. diff -r 034cdbd34c0a -r 8b4a99ae3b5e test/fntests.m --- a/test/fntests.m Wed Jun 07 15:38:58 2006 +0000 +++ b/test/fntests.m Wed Jun 07 18:11:24 2006 +0000 @@ -1,6 +1,7 @@ clear all; global files_with_no_tests = {}; +global files_with_tests = {}; global topsrcdir; currdir = canonicalize_file_name ("."); @@ -49,6 +50,7 @@ endfunction function [dp, dn] = run_test_dir (fid, d); + global files_with_tests; global files_with_no_tests; lst = dir (d); dp = dn = 0; @@ -57,12 +59,14 @@ if (length (nm) > 5 && strcmp (nm(1:5), "test_") && strcmp (nm((end-1):end), ".m")) p = n = 0; - if (hastests (fullfile (d, nm))) + ffnm = fullfile (d, nm); + if (hastests (ffnm)) print_test_file_name (nm); [p, n] = test (nm(1:(end-2)), "quiet", fid); print_pass_fail (n, p); + files_with_tests(end+1) = ffnm; else - files_with_no_tests(end+1) = fullfile (d, nm); + files_with_no_tests(end+1) = ffnm; endif dp += p; dn += n; @@ -71,6 +75,7 @@ endfunction function [dp, dn] = run_test_script (fid, d); + global files_with_tests; global files_with_no_tests; global topsrcdir; lst = dir (d); @@ -97,6 +102,7 @@ print_pass_fail (n, p); dp += p; dn += n; + files_with_tests(end+1) = f; else files_with_no_tests(end+1) = f; endif @@ -148,7 +154,9 @@ printf ("\nSummary:\n\n PASS %6d\n", dp); nfail = dn - dp; printf (" FAIL %6d\n", nfail); - printf ("\n%d files have no tests\n", length (files_with_no_tests)); + 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\n", n_files_with_no_tests, n_files); fprintf (fid, "\nFiles with no tests:\n\n%s", list_in_columns (files_with_no_tests, 80)); fclose (fid);