Mercurial > octave-nkf
comparison scripts/testfun/runtests.m @ 18053:7c9148b235eb
runtests.m: Also runtests for files that only contain %!xtest (bug #40780)
* runtests.m : Add xtest to regexp searching for test code in m-file.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 03 Dec 2013 09:04:09 -0800 |
parents | d63878346099 |
children | 70e83c641b48 |
comparison
equal
deleted
inserted
replaced
18051:e6c17e9bc600 | 18053:7c9148b235eb |
---|---|
125 function retval = has_tests (f) | 125 function retval = has_tests (f) |
126 fid = fopen (f); | 126 fid = fopen (f); |
127 if (fid >= 0) | 127 if (fid >= 0) |
128 str = fread (fid, "*char").'; | 128 str = fread (fid, "*char").'; |
129 fclose (fid); | 129 fclose (fid); |
130 retval = ! isempty (regexp (str, '^%!(?:test|assert|error|warning)', | 130 retval = ! isempty (regexp (str, '^%!(?:test|xtest|assert|error|warning)', |
131 'lineanchors', 'once')); | 131 'lineanchors', 'once')); |
132 else | 132 else |
133 error ("runtests: fopen failed: %s", f); | 133 error ("runtests: fopen failed: %s", f); |
134 endif | 134 endif |
135 endfunction | 135 endfunction |