comparison test/publish/publish.tst @ 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 7854d5752dd2
comparison
equal deleted inserted replaced
28086:32af6bb2a120 28087:9cb04a9e81ec
47 %! opts.outputDir = tmpDir; 47 %! opts.outputDir = tmpDir;
48 %! for fname = {scripts.name} 48 %! for fname = {scripts.name}
49 %! publish (fname{1}, opts); 49 %! publish (fname{1}, opts);
50 %! endfor 50 %! endfor
51 %! confirm_recursive_rmdir (false, "local"); 51 %! confirm_recursive_rmdir (false, "local");
52 %! rmdir (tmpDir, "s"); 52 %! sts = rmdir (tmpDir, "s");
53 %! unwind_protect_cleanup 53 %! unwind_protect_cleanup
54 %! set (0, "defaultfigurevisible", visibility); 54 %! set (0, "defaultfigurevisible", visibility);
55 %! graphics_toolkit (toolkit); 55 %! graphics_toolkit (toolkit);
56 %! end_unwind_protect 56 %! end_unwind_protect
57 57
79 %! ## Call publish and grabcode 79 %! ## Call publish and grabcode
80 %! publish ("test_script.m", opts); 80 %! publish ("test_script.m", opts);
81 %! str1 = fileread ("test_script.m"); 81 %! str1 = fileread ("test_script.m");
82 %! str2 = grabcode (fullfile (tmpDir, "test_script.html")); 82 %! str2 = grabcode (fullfile (tmpDir, "test_script.html"));
83 %! confirm_recursive_rmdir (false, "local"); 83 %! confirm_recursive_rmdir (false, "local");
84 %! rmdir (tmpDir, "s"); 84 %! sts = rmdir (tmpDir, "s");
85 %! ## Canonicalize strings 85 %! ## Canonicalize strings
86 %! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n"); 86 %! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n");
87 %! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n"); 87 %! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n");
88 %! assert (hash ("md5", str1), hash ("md5", str2)); 88 %! assert (hash ("md5", str1), hash ("md5", str2));
89 %! unwind_protect_cleanup 89 %! unwind_protect_cleanup