Mercurial > octave
changeset 27928:6804f2feea46
__run_test_suite__.m: Validate .m/.cc names are files before proceeding.
* __run_test_suite__.m: Use isfile() to guarantee possible name is
actually a file before calling fopen on it.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 10 Jan 2020 12:08:07 -0800 |
parents | 88e04bb41eba |
children | 265b386f8b20 |
files | scripts/testfun/__run_test_suite__.m |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/testfun/__run_test_suite__.m Fri Jan 10 10:34:45 2020 -0800 +++ b/scripts/testfun/__run_test_suite__.m Fri Jan 10 12:08:07 2020 -0800 @@ -185,13 +185,17 @@ nm = lst(i).name; ## Ignore hidden files if (nm(1) == '.') - continue + continue; endif if ((! is_fixed && length (nm) > 2 && strcmpi (nm((end-1):end), ".m")) || (! is_fixed && length (nm) > 4 && strcmpi (nm((end-3):end), "-tst")) || (is_fixed && length (nm) > 4 && strcmpi (nm((end-3):end), ".tst"))) p = n = xf = xb = sk = rtsk = rgrs = 0; ffnm = fullfile (d, nm); + if (! isfile (ffnm)) + continue; + endif + ## Only run if contains %!test, %!assert, %!error, %!fail, or %!warning if (has_tests (ffnm)) tmp = reduce_test_file_name (ffnm, topbuilddir, topsrcdir);