Mercurial > octave
comparison scripts/miscellaneous/run.m @ 28087:9cb04a9e81ec
rmdir: throw an error if operation fails and nargout == 0 (bug #57830).
* dirfns.cc (Frmdir): Change DEFMETHODX macro invocation to include nargout variable.
Check nargout, and for cases where "nargout == 0" and "status" indicates failure,
throw an error. For cases where "nargout > 0", return 3-value octave_value_list
in variable "retval".
* file-io.cc, gzip.cc, dir.m, isfolder.m, mkdir.m, run.m, tar.m,
unpack.m, zip.m, pathdef.m, savepath.m, configure_make.m, install.m,
uninstall.m, getpref.m, setpref.m, pkg.tst, publish.tst, system.tst:
Change calls from "rmdir" to "sts = rmdir" so that an error is not
unecessarily thrown in BIST tests and other clean up code.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 17 Feb 2020 20:02:18 -0800 |
parents | bd51beb6205e |
children | d8318c12d903 |
comparison
equal
deleted
inserted
replaced
28086:32af6bb2a120 | 28087:9cb04a9e81ec |
---|---|
112 %! run (test_script); | 112 %! run (test_script); |
113 %! assert (exist ("_5yVNhWVJWJn47RKnzxPsyb_", "var"), 1); | 113 %! assert (exist ("_5yVNhWVJWJn47RKnzxPsyb_", "var"), 1); |
114 %! assert (_5yVNhWVJWJn47RKnzxPsyb_, 1337); | 114 %! assert (_5yVNhWVJWJn47RKnzxPsyb_, 1337); |
115 %! unwind_protect_cleanup | 115 %! unwind_protect_cleanup |
116 %! unlink (test_script); | 116 %! unlink (test_script); |
117 %! rmdir (tmp_dir); | 117 %! sts = rmdir (tmp_dir); |
118 %! end_unwind_protect | 118 %! end_unwind_protect |
119 | 119 |
120 ## Test function file execution | 120 ## Test function file execution |
121 %!test | 121 %!test |
122 %! path_orig = path (); | 122 %! path_orig = path (); |
138 %! tstval2 = any (is_same_file (tmp_dir, dirs)); | 138 %! tstval2 = any (is_same_file (tmp_dir, dirs)); |
139 %! assert (tstval1, false); | 139 %! assert (tstval1, false); |
140 %! assert (tstval2, true); | 140 %! assert (tstval2, true); |
141 %! unwind_protect_cleanup | 141 %! unwind_protect_cleanup |
142 %! unlink (test_function); | 142 %! unlink (test_function); |
143 %! rmdir (tmp_dir); | 143 %! sts = rmdir (tmp_dir); |
144 %! path (path_orig); | 144 %! path (path_orig); |
145 %! end_unwind_protect | 145 %! end_unwind_protect |
146 | 146 |
147 ## Test input validation | 147 ## Test input validation |
148 %!error run () | 148 %!error run () |