changeset 25645:0214d9dabba2

Disable opening GUI editor on breakpoints when running BIST tests for dbstop (bug #49119) * debug.cc: in BIST tests, use unwind_protect block to save/restore value of GUI preference to open file in Editor window when dbstop is used.
author Rik <rik@octave.org>
date Thu, 19 Jul 2018 20:11:31 -0700
parents bee8d60413f3
children 4d565baa475e
files libinterp/corefcn/debug.cc
diffstat 1 files changed, 22 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Thu Jul 19 13:40:47 2018 -0400
+++ b/libinterp/corefcn/debug.cc	Thu Jul 19 20:11:31 2018 -0700
@@ -523,18 +523,28 @@
 
 /*
 %!test
-%! dbclear all;   # Clear out breakpoints before test
-%! dbstop @ftp/dir;
-%! dbstop @audioplayer/set 70;
-%! dbstop quantile>__quantile__;
-%! dbstop ls;
-%! s = dbstatus;
-%! dbclear all;
-%! assert (s(1).name, "@audioplayer/set>setproperty");
-%! assert (s(2).name, "@ftp/dir");
-%! assert (s(3).name, "ls");
-%! assert (s(4).name, "quantile>__quantile__");
-%! assert (s(2).file(end-10:end), [filesep "@ftp" filesep "dir.m"]);
+%! if (isguirunning ())
+%!   orig_show_dbg = __octave_link_gui_preference__ ("editor/show_dbg_file",
+%!                                                   "0");
+%! endif
+%! unwind_protect 
+%!   dbclear all;   # Clear out breakpoints before test
+%!   dbstop @ftp/dir;
+%!   dbstop @audioplayer/set 70;
+%!   dbstop quantile>__quantile__;
+%!   dbstop ls;
+%!   s = dbstatus;
+%!   dbclear all;
+%!   assert (s(1).name, "@audioplayer/set>setproperty");
+%!   assert (s(2).name, "@ftp/dir");
+%!   assert (s(3).name, "ls");
+%!   assert (s(4).name, "quantile>__quantile__");
+%!   assert (s(2).file(end-10:end), [filesep "@ftp" filesep "dir.m"]);
+%! unwind_protect_cleanup
+%!   if (isguirunning ())
+%!     __octave_link_gui_preference__ ("editor/show_dbg_file", orig_show_dbg);
+%!   endif
+%! end_unwind_protect
 */
 
 DEFMETHOD (dbwhere, interp, , ,