annotate test/fntests.m @ 14351:e257d7363133

improve test summary message * fntests.m: If there are expected failures or skipped tests, include XFAIL and SKIPPED lines along wiht PASS and FAIL. Provide more information about skipped tests.
author John W. Eaton <jwe@octave.org>
date Thu, 09 Feb 2012 13:39:34 -0500
parents 72c96de7a403
children 775fed9ed47d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 13833
diff changeset
1 ## Copyright (C) 2005-2012 David Bateman
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
2 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
3 ## This file is part of Octave.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
4 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
6 ## under the terms of the GNU General Public License as published by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
8 ## your option) any later version.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
9 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
13 ## General Public License for more details.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
14 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
15 ## You should have received a copy of the GNU General Public License
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
17 ## <http://www.gnu.org/licenses/>.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6731
diff changeset
18
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
19 clear all;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
20
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
21 global files_with_no_tests = {};
5845
8b4a99ae3b5e [project @ 2006-06-07 18:11:24 by jwe]
jwe
parents: 5840
diff changeset
22 global files_with_tests = {};
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
23 global topsrcdir;
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
24 global topbuilddir;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
25
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
26 currdir = canonicalize_file_name (".");
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
27
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
28 if (nargin == 1)
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5667
diff changeset
29 xdir = argv(){1};
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
30 else
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
31 xdir = ".";
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
32 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
33
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
34 srcdir = canonicalize_file_name (xdir);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
35 topsrcdir = canonicalize_file_name (fullfile (xdir, ".."));
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
36 topbuilddir = canonicalize_file_name (fullfile (currdir, ".."));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
37
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
38 if (strcmp (currdir, srcdir))
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
39 testdirs = {srcdir};
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
40 else
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
41 testdirs = {currdir, srcdir};
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
42 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
43
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
44 src_tree = canonicalize_file_name (fullfile (topsrcdir, "src"));
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
45 liboctave_tree = canonicalize_file_name (fullfile (topsrcdir, "liboctave"));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
46 script_tree = canonicalize_file_name (fullfile (topsrcdir, "scripts"));
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
47 local_script_tree = canonicalize_file_name (fullfile (currdir, "../scripts"));
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
48
6162
b3c425131211 [project @ 2006-11-14 15:33:22 by jwe]
jwe
parents: 5845
diff changeset
49 fundirs = {src_tree, liboctave_tree, script_tree};
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
50
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
51 if (! strcmp (currdir, srcdir))
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
52 fundirs{end+1} = local_script_tree;
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
53 endif
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
54
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
55 function print_test_file_name (nm)
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
56 filler = repmat (".", 1, 55-length (nm));
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
57 printf (" %s %s", nm, filler);
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
58 endfunction
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
59
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
60 function print_pass_fail (n, p)
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
61 if (n > 0)
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
62 printf (" PASS %4d/%-4d", p, n);
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
63 nfail = n - p;
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
64 if (nfail > 0)
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
65 printf (" FAIL %d", nfail);
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
66 endif
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
67 endif
7762
9c24ca8761f7 fntests.m: minor cleanups
John W. Eaton <jwe@octave.org>
parents: 7645
diff changeset
68 puts ("\n");
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
69 endfunction
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
70
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
71 function retval = has_functions (f)
10220
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
72 n = length (f);
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
73 if (n > 3 && strcmp (f((end-2):end), ".cc"))
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
74 fid = fopen (f);
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
75 if (fid >= 0)
10220
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
76 str = fread (fid, "*char")';
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
77 fclose (fid);
12462
e4dbfe3019b1 Use PCRE regular expressions throughout Octave.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
78 retval = ! isempty (regexp (str,'^(DEFUN|DEFUN_DLD)\b', 'lineanchors'));
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
79 else
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
80 error ("fopen failed: %s", f);
10220
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
81 endif
04f2b4d68eba test/fntests.m (hasfunctions): assume .m files have functions
John W. Eaton <jwe@octave.org>
parents: 10112
diff changeset
82 elseif (n > 2 && strcmp (f((end-1):end), ".m"))
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
83 retval = true;
9742
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
84 else
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
85 retval = false;
9742
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
86 endif
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
87 endfunction
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
88
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
89 function retval = has_tests (f)
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
90 fid = fopen (f);
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
91 if (fid >= 0)
8699
6e764b7317bd test/fntests.m, scripts/test/demo.m: error on fopen failures
John W. Eaton <jwe@octave.org>
parents: 8423
diff changeset
92 str = fread (fid, "*char")';
6e764b7317bd test/fntests.m, scripts/test/demo.m: error on fopen failures
John W. Eaton <jwe@octave.org>
parents: 8423
diff changeset
93 fclose (fid);
13069
48c94e21b57f codesprint: recognize "fail" as a test in fntests.m
John W. Eaton <jwe@octave.org>
parents: 13049
diff changeset
94 retval = ! isempty (regexp (str, '^%!(assert|error|fail|test|warning)', "lineanchors"));
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
95 else
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
96 error ("fopen failed: %s", f);
8699
6e764b7317bd test/fntests.m, scripts/test/demo.m: error on fopen failures
John W. Eaton <jwe@octave.org>
parents: 8423
diff changeset
97 endif
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
98 endfunction
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
99
12589
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
100 function retval = has_demos (f)
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
101 fid = fopen (f);
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
102 if (fid >= 0)
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
103 str = fread (fid, "*char")';
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
104 fclose (fid);
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
105 retval = ! isempty (regexp (str, '^%!demo', "lineanchors"));
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
106 else
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
107 error ("fopen failed: %s", f);
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
108 endif
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
109 endfunction
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
110
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
111 function [dp, dn, dxf, dsk] = run_test_dir (fid, d);
5845
8b4a99ae3b5e [project @ 2006-06-07 18:11:24 by jwe]
jwe
parents: 5840
diff changeset
112 global files_with_tests;
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
113 global files_with_no_tests;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
114 lst = dir (d);
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
115 dp = dn = dxf = dsk = 0;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
116 for i = 1:length (lst)
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
117 nm = lst(i).name;
13192
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
118 if (lst(i).isdir
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
119 && ! strcmp (nm, ".") && ! strcmp (nm, "..")
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
120 && ! strcmp (nm, "private") && nm(1) != "@"
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
121 && ! strcmp (nm, "CVS"))
13833
0a28c49cb477 Format test suite output correctly on Win32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13192
diff changeset
122 [p, n, xf, sk] = run_test_dir (fid, [d, filesep, nm]);
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
123 dp += p;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
124 dn += n;
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
125 dxf += xf;
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
126 dsk += sk;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
127 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
128 endfor
13192
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
129 saved_dir = pwd ();
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
130 unwind_protect
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
131 chdir (d);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
132 for i = 1:length (lst)
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
133 nm = lst(i).name;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
134 if (length (nm) > 5 && strcmp (nm(1:5), "test_")
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
135 && strcmp (nm((end-1):end), ".m"))
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
136 p = n = xf = sk = 0;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
137 ffnm = fullfile (d, nm);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
138 if (has_tests (ffnm))
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
139 print_test_file_name (nm);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
140 [p, n, xf, sk] = test (nm(1:(end-2)), "quiet", fid);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
141 print_pass_fail (n, p);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
142 files_with_tests(end+1) = ffnm;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
143 ##elseif (has_demos (ffnm))
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
144 ## files_with_tests(end+1) = ffnm;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
145 else
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
146 files_with_no_tests(end+1) = ffnm;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
147 endif
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
148 dp += p;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
149 dn += n;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
150 dxf += xf;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
151 dsk += sk;
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
152 endif
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
153 endfor
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
154 unwind_protect_cleanup
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
155 chdir (saved_dir);
968e89b45bbf move tests for classes into subdirectories
John W. Eaton <jwe@octave.org>
parents: 13069
diff changeset
156 end_unwind_protect
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
157 endfunction
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
158
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
159 function [dp, dn, dxf, dsk] = run_test_script (fid, d);
5845
8b4a99ae3b5e [project @ 2006-06-07 18:11:24 by jwe]
jwe
parents: 5840
diff changeset
160 global files_with_tests;
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
161 global files_with_no_tests;
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5667
diff changeset
162 global topsrcdir;
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6162
diff changeset
163 global topbuilddir;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
164 lst = dir (d);
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
165 dp = dn = dxf = dsk = 0;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
166 for i = 1:length (lst)
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
167 nm = lst(i).name;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
168 if (lst(i).isdir && ! strcmp (nm, ".") && ! strcmp (nm, "..")
11227
84846912f3c1 test/fntests.m: run tests for deprecated functions
John W. Eaton <jwe@octave.org>
parents: 11054
diff changeset
169 && ! strcmp (nm, "CVS"))
13833
0a28c49cb477 Format test suite output correctly on Win32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13192
diff changeset
170 [p, n, xf, sk] = run_test_script (fid, [d, filesep, nm]);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
171 dp += p;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
172 dn += n;
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
173 dxf += xf;
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
174 dsk += sk;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
175 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
176 endfor
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
177 for i = 1:length (lst)
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
178 nm = lst(i).name;
10112
fddfebeeb33a Run tests in all *.cc files.
David Grundberg <davidg@cs.umu.se>
parents: 10026
diff changeset
179 ## Ignore hidden files
fddfebeeb33a Run tests in all *.cc files.
David Grundberg <davidg@cs.umu.se>
parents: 10026
diff changeset
180 if (nm(1) == '.')
fddfebeeb33a Run tests in all *.cc files.
David Grundberg <davidg@cs.umu.se>
parents: 10026
diff changeset
181 continue
fddfebeeb33a Run tests in all *.cc files.
David Grundberg <davidg@cs.umu.se>
parents: 10026
diff changeset
182 endif
9742
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
183 f = fullfile (d, nm);
9f8ff01abc65 .cc files are now included in the list of files requiring
Rik <rdrider0-list@yahoo.com>
parents: 9741
diff changeset
184 if ((length (nm) > 2 && strcmp (nm((end-1):end), ".m")) ||
10112
fddfebeeb33a Run tests in all *.cc files.
David Grundberg <davidg@cs.umu.se>
parents: 10026
diff changeset
185 (length (nm) > 3 && strcmp (nm((end-2):end), ".cc")))
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
186 p = n = xf = 0;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
187 ## Only run if it contains %!test, %!assert %!error or %!warning
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
188 if (has_tests (f))
13833
0a28c49cb477 Format test suite output correctly on Win32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13192
diff changeset
189 tmp = strrep (f, [topsrcdir, filesep], "");
0a28c49cb477 Format test suite output correctly on Win32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13192
diff changeset
190 tmp = strrep (tmp, [topbuilddir, filesep], ["..", filesep]);
11033
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
191 print_test_file_name (tmp);
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
192 [p, n, xf, sk] = test (f, "quiet", fid);
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
193 print_pass_fail (n, p);
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
194 dp += p;
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
195 dn += n;
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
196 dxf += xf;
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
197 dsk += sk;
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
198 files_with_tests(end+1) = f;
13043
098c8e696236 fntests.m: No longer count file with demos as being tested
Rik <octave@nomad.inbox5.com>
parents: 12589
diff changeset
199 ##elseif (has_demos (f))
098c8e696236 fntests.m: No longer count file with demos as being tested
Rik <octave@nomad.inbox5.com>
parents: 12589
diff changeset
200 ## files_with_tests(end+1) = f;
11024
fa56fd98c0c5 Remove requirement for PCRE in Octave. (Bug #31025)
Rik <octave@nomad.inbox5.com>
parents: 11019
diff changeset
201 elseif (has_functions (f))
11033
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
202 ## To reduce the list length, only mark .cc files that contain
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
203 ## DEFUN definitions.
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
204 files_with_no_tests(end+1) = f;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
205 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
206 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
207 endfor
5667
ec3ffbf9982b [project @ 2006-03-15 02:51:39 by jwe]
jwe
parents: 5590
diff changeset
208 ## printf("%s%s -> passes %d of %d tests\n", ident, d, dp, dn);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
209 endfunction
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
210
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
211 function printf_assert (varargin)
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
212 global _assert_printf;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
213 _assert_printf = cat (2, _assert_printf, sprintf (varargin{:}));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
214 endfunction
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
215
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
216 function ret = prog_output_assert (str)
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
217 global _assert_printf;
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
218 if (isempty (_assert_printf))
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
219 ret = isempty (str);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
220 elseif (_assert_printf(end) == "\n")
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
221 ret = strcmp (_assert_printf(1:(end-1)), str);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
222 else
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
223 ret = strcmp (_assert_printf, str);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
224 endif
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
225 _assert_printf = "";
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
226 endfunction
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
227
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
228 function n = num_elts_matching_pattern (lst, pat)
12589
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
229 n = sum (cellfun (@(x) !isempty (x), regexp (lst, pat, 'once')));
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
230 endfunction
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
231
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
232 function report_files_with_no_tests (with, without, typ)
12589
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
233 pat = cstrcat ('\', typ, "$");
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
234 n_with = num_elts_matching_pattern (with, pat);
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
235 n_without = num_elts_matching_pattern (without, pat);
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
236 n_tot = n_with + n_without;
13049
b37d8e5aedf3 fntests.m: Remove statement about demos from "No Tests" message
Rik <octave@nomad.inbox5.com>
parents: 13043
diff changeset
237 printf ("\n%d (of %d) %s files have no tests.\n", n_without, n_tot, typ);
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
238 endfunction
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
239
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
240 pso = page_screen_output ();
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
241 warn_state = warning ("query", "quiet");
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
242 warning ("on", "quiet");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
243 try
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
244 page_screen_output (0);
11227
84846912f3c1 test/fntests.m: run tests for deprecated functions
John W. Eaton <jwe@octave.org>
parents: 11054
diff changeset
245 warning ("off", "Octave:deprecated-functions");
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
246 fid = fopen ("fntests.log", "wt");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
247 if (fid < 0)
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
248 error ("could not open fntests.log for writing");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
249 endif
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
250 test ("", "explain", fid);
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
251 dp = dn = dxf = dsk = 0;
7762
9c24ca8761f7 fntests.m: minor cleanups
John W. Eaton <jwe@octave.org>
parents: 7645
diff changeset
252 puts ("\nIntegrated test scripts:\n\n");
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
253 for i = 1:length (fundirs)
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
254 [p, n, xf, sk] = run_test_script (fid, fundirs{i});
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
255 dp += p;
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
256 dn += n;
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
257 dxf += xf;
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
258 dsk += sk;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
259 endfor
7762
9c24ca8761f7 fntests.m: minor cleanups
John W. Eaton <jwe@octave.org>
parents: 7645
diff changeset
260 puts ("\nFixed test scripts:\n\n");
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
261 for i = 1:length (testdirs)
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
262 [p, n, xf, sk] = run_test_dir (fid, testdirs{i});
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
263 dp += p;
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
264 dn += n;
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
265 dxf += xf;
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
266 dsk += sk;
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
267 endfor
14351
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
268 puts ("\nSummary:\n\n");
5667
ec3ffbf9982b [project @ 2006-03-15 02:51:39 by jwe]
jwe
parents: 5590
diff changeset
269 nfail = dn - dp;
14351
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
270 printf (" PASS %6d\n", dp);
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
271 printf (" FAIL %6d\n", nfail);
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
272 if (dxf > 0)
14351
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
273 printf (" XFAIL %6d\n", dxf);
6730
230f9c49857e [project @ 2007-06-15 04:22:13 by jwe]
jwe
parents: 6277
diff changeset
274 endif
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
275 if (dsk > 0)
14351
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
276 printf (" SKIPPED %6d\n", dsk);
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
277 endif
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
278 puts ("\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
279 puts ("See the file test/fntests.log for additional details.\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
280 if (dxf > 0)
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
281 puts ("\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
282 puts ("Expected failures (listed as XFAIL above) are known bugs.\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
283 puts ("Please help improve Octave by contributing fixes for them.\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
284 endif
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
285 if (dsk > 0)
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
286 puts ("\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
287 puts ("Tests are most often skipped because the features they require\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
288 puts ("have been disabled. Features are most often disabled because\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
289 puts ("they require dependencies that were not present when Octave\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
290 puts ("was built. The configure script should have printed a summary\n");
e257d7363133 improve test summary message
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
291 puts ("at the end of its run indicating which dependencies were not found.\n");
7243
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
292 endif
e8d7eed42935 [project @ 2007-12-04 02:10:17 by jwe]
jwe
parents: 7016
diff changeset
293
12589
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
294 ## Weed out deprecated and private functions
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
295 weed_idx = cellfun (@isempty, regexp (files_with_tests, '\bdeprecated\b|\bprivate\b', 'once'));
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
296 files_with_tests = files_with_tests(weed_idx);
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
297 weed_idx = cellfun (@isempty, regexp (files_with_no_tests, '\bdeprecated\b|\bprivate\b', 'once'));
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
298 files_with_no_tests = files_with_no_tests(weed_idx);
890af1cf0a86 Remove deprecated and private functions from list of functions requiring tests.
Rik <octave@nomad.inbox5.com>
parents: 12469
diff changeset
299
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
300 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".m");
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
301 report_files_with_no_tests (files_with_tests, files_with_no_tests, ".cc");
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
302
9710
519e164dde1e Fix typo of an extra space in instructions to user
Rik <rdrider0-list@yahoo.com>
parents: 9696
diff changeset
303 puts ("\nPlease help improve Octave by contributing tests for\n");
10899
686e3bc432a2 fntests.m: Add extra newline for more readable output during make.
Rik <octave@nomad.inbox5.com>
parents: 10220
diff changeset
304 puts ("these files (see the list in the file fntests.log).\n\n");
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
305
5840
257643fc806b [project @ 2006-06-01 22:08:00 by jwe]
jwe
parents: 5836
diff changeset
306 fprintf (fid, "\nFiles with no tests:\n\n%s",
11033
d9c8916bb9dd Untabify a few remaining .m scripts.
Rik <octave@nomad.inbox5.com>
parents: 11032
diff changeset
307 list_in_columns (files_with_no_tests, 80));
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
308 fclose (fid);
7645
734854f21c94 fntests.m: report number .m and .cc files without tests separately
John W. Eaton <jwe@octave.org>
parents: 7300
diff changeset
309
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
310 page_screen_output (pso);
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
311 warning (warn_state.state, "quiet");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
312 catch
5836
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
313 page_screen_output (pso);
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
314 warning (warn_state.state, "quiet");
ed69a3b5b3d0 [project @ 2006-06-01 16:16:00 by jwe]
jwe
parents: 5781
diff changeset
315 disp (lasterr ());
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
316 end_try_catch