Mercurial > octave-nkf
comparison scripts/testfun/rundemos.m @ 17456:2c2a6801cb57
rundemos.m, runtests.m: Operate on .cc files (bug #40052)
* rundemos.m, runtests.m: Copy logic from a previous version of fntests
to operate on C++ source files for development use. Update docstrings.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sat, 21 Sep 2013 07:33:49 -0400 |
parents | fa14aa77b514 |
children | a4f86f459744 |
comparison
equal
deleted
inserted
replaced
17455:b76b14e386b3 | 17456:2c2a6801cb57 |
---|---|
18 | 18 |
19 ## -*- texinfo -*- | 19 ## -*- texinfo -*- |
20 ## @deftypefn {Function File} {} rundemos () | 20 ## @deftypefn {Function File} {} rundemos () |
21 ## @deftypefnx {Function File} {} rundemos (@var{directory}) | 21 ## @deftypefnx {Function File} {} rundemos (@var{directory}) |
22 ## Execute built-in demos for all function files in the specified directory. | 22 ## Execute built-in demos for all function files in the specified directory. |
23 ## Also executes demos in any C++ source files found in the directory, for | |
24 ## use with dynamically linked functions. | |
25 ## | |
23 ## If no directory is specified, operate on all directories in Octave's | 26 ## If no directory is specified, operate on all directories in Octave's |
24 ## search path for functions. | 27 ## search path for functions. |
25 ## @seealso{runtests, path} | 28 ## @seealso{runtests, path} |
26 ## @end deftypefn | 29 ## @end deftypefn |
27 | 30 |
60 | 63 |
61 function run_all_demos (directory) | 64 function run_all_demos (directory) |
62 flist = readdir (directory); | 65 flist = readdir (directory); |
63 for i = 1:numel (flist) | 66 for i = 1:numel (flist) |
64 f = flist{i}; | 67 f = flist{i}; |
65 if (length (f) > 2 && strcmp (f((end-1):end), ".m")) | 68 if ((length (f) > 2 && strcmpi (f((end-1):end), ".m")) || |
69 (length (f) > 3 && strcmpi (f((end-2):end), ".cc"))) | |
66 f = fullfile (directory, f); | 70 f = fullfile (directory, f); |
67 if (has_demos (f)) | 71 if (has_demos (f)) |
68 try | 72 try |
69 demo (f); | 73 demo (f); |
70 catch | 74 catch |