Mercurial > octave-nkf
comparison scripts/testfun/__run_test_suite__.m @ 18166:c9b4d3177de3
Don't count expected failures as passed tests.
* test.m: count expected failures separately from passed tests
* __run_test_suite__.m: report expected failures and skipped
tests during progress
author | Carlo de Falco <cdf@users.sourceforge.net> |
---|---|
date | Mon, 23 Dec 2013 18:38:53 +0100 |
parents | 523dd79ee726 |
children | 441121728230 |
comparison
equal
deleted
inserted
replaced
18165:d6aaf821cf8f | 18166:c9b4d3177de3 |
---|---|
64 dn += n; | 64 dn += n; |
65 dxf += xf; | 65 dxf += xf; |
66 dsk += sk; | 66 dsk += sk; |
67 endfor | 67 endfor |
68 puts ("\nSummary:\n\n"); | 68 puts ("\nSummary:\n\n"); |
69 nfail = dn - dp; | 69 nfail = dn - dp - dxf; |
70 printf (" PASS %6d\n", dp); | 70 printf (" PASS %6d\n", dp); |
71 printf (" FAIL %6d\n", nfail); | 71 printf (" FAIL %6d\n", nfail); |
72 if (dxf > 0) | 72 if (dxf > 0) |
73 printf (" XFAIL %6d\n", dxf); | 73 printf (" XFAIL %6d\n", dxf); |
74 endif | 74 endif |
114 disp (lasterr ()); | 114 disp (lasterr ()); |
115 end_try_catch | 115 end_try_catch |
116 endfunction | 116 endfunction |
117 | 117 |
118 function print_test_file_name (nm) | 118 function print_test_file_name (nm) |
119 filler = repmat (".", 1, 55-length (nm)); | 119 filler = repmat (".", 1, 52-length (nm)); |
120 printf (" %s %s", nm, filler); | 120 printf (" %s %s", nm, filler); |
121 endfunction | 121 endfunction |
122 | 122 |
123 function print_pass_fail (n, p) | 123 function print_pass_fail (p, n, xf, sk) |
124 if (n > 0) | 124 if ((n + sk) > 0) |
125 printf (" PASS %4d/%-4d", p, n); | 125 printf (" PASS %4d/%-4d", p, n); |
126 nfail = n - p; | 126 nfail = n - p - xf; |
127 if (nfail > 0) | 127 if (nfail > 0) |
128 printf (" FAIL %d", nfail); | 128 printf (" FAIL %-4d", nfail); |
129 endif | |
130 if (sk > 0) | |
131 printf (" (SKIP %-4d)", sk); | |
132 endif | |
133 if (xf > 0) | |
134 printf (" (XFAIL %-4d)", xf); | |
129 endif | 135 endif |
130 endif | 136 endif |
131 puts ("\n"); | 137 puts ("\n"); |
132 endfunction | 138 endfunction |
133 | 139 |
188 p = n = xf = sk = 0; | 194 p = n = xf = sk = 0; |
189 ffnm = fullfile (d, nm); | 195 ffnm = fullfile (d, nm); |
190 if (has_tests (ffnm)) | 196 if (has_tests (ffnm)) |
191 print_test_file_name (nm); | 197 print_test_file_name (nm); |
192 [p, n, xf, sk] = test (nm, "quiet", fid); | 198 [p, n, xf, sk] = test (nm, "quiet", fid); |
193 print_pass_fail (n, p); | 199 print_pass_fail (p, n, xf, sk); |
194 files_with_tests(end+1) = ffnm; | 200 files_with_tests(end+1) = ffnm; |
195 else | 201 else |
196 files_with_no_tests(end+1) = ffnm; | 202 files_with_no_tests(end+1) = ffnm; |
197 endif | 203 endif |
198 dp += p; | 204 dp += p; |
239 if (has_tests (f)) | 245 if (has_tests (f)) |
240 tmp = strrep (f, [topsrcdir, filesep], ""); | 246 tmp = strrep (f, [topsrcdir, filesep], ""); |
241 tmp = strrep (tmp, [topbuilddir, filesep], ""); | 247 tmp = strrep (tmp, [topbuilddir, filesep], ""); |
242 print_test_file_name (tmp); | 248 print_test_file_name (tmp); |
243 [p, n, xf, sk] = test (f, "quiet", fid); | 249 [p, n, xf, sk] = test (f, "quiet", fid); |
244 print_pass_fail (n, p); | 250 print_pass_fail (p, n, xf, sk); |
245 dp += p; | 251 dp += p; |
246 dn += n; | 252 dn += n; |
247 dxf += xf; | 253 dxf += xf; |
248 dsk += sk; | 254 dsk += sk; |
249 files_with_tests(end+1) = f; | 255 files_with_tests(end+1) = f; |