changeset 22532:c06e83d47ac3

Check at run-time for a window system befor executing HAVE_FLTK tests (bug #49138). * graphics.cc, uimenu.m, allchild.m, findall.m, graphics_toolkit.m: Preface BIST tests that use testif HAVE_FLTK with a run-time check based on have_window_system().
author Rik <rik@octave.org>
date Fri, 23 Sep 2016 09:03:30 -0700
parents bcd2630c14f3
children d084f11189f9
files libinterp/corefcn/graphics.cc scripts/gui/uimenu.m scripts/plot/util/allchild.m scripts/plot/util/findall.m scripts/plot/util/graphics_toolkit.m
diffstat 5 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Thu Sep 22 14:39:10 2016 -0500
+++ b/libinterp/corefcn/graphics.cc	Fri Sep 23 09:03:30 2016 -0700
@@ -4632,6 +4632,9 @@
 
 /*
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! unwind_protect
@@ -4650,7 +4653,11 @@
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
+
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! fpos = get (hf, "position");
@@ -4669,7 +4676,11 @@
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
+
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! fpos = get (hf, "position");
--- a/scripts/gui/uimenu.m	Thu Sep 22 14:39:10 2016 -0500
+++ b/scripts/gui/uimenu.m	Fri Sep 23 09:03:30 2016 -0700
@@ -104,6 +104,9 @@
 %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)');
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! toolkit = graphics_toolkit ("fltk");
 %! hf = figure ("visible", "off");
 %! unwind_protect
@@ -121,6 +124,9 @@
 
 ## check for top level menus file and edit
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! toolkit = graphics_toolkit ("fltk");
 %! hf = figure ("visible", "off");
 %! unwind_protect
@@ -134,6 +140,9 @@
 %! end_unwind_protect
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! toolkit = graphics_toolkit ("fltk");
 %! hf = figure ("visible", "off");
 %! unwind_protect
--- a/scripts/plot/util/allchild.m	Thu Sep 22 14:39:10 2016 -0500
+++ b/scripts/plot/util/allchild.m	Fri Sep 23 09:03:30 2016 -0700
@@ -49,6 +49,9 @@
 
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! toolkit = graphics_toolkit ("fltk");
 %! hf = figure ("visible", "off");
 %! unwind_protect
--- a/scripts/plot/util/findall.m	Thu Sep 22 14:39:10 2016 -0500
+++ b/scripts/plot/util/findall.m	Fri Sep 23 09:03:30 2016 -0700
@@ -51,6 +51,9 @@
 
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! toolkit = graphics_toolkit ("fltk");
 %! hf = figure ("visible", "off");
 %! unwind_protect
--- a/scripts/plot/util/graphics_toolkit.m	Thu Sep 22 14:39:10 2016 -0500
+++ b/scripts/plot/util/graphics_toolkit.m	Fri Sep 23 09:03:30 2016 -0700
@@ -104,6 +104,9 @@
 
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! unwind_protect
 %!   hf = figure ("visible", "off");
 %!   toolkit = graphics_toolkit ();
@@ -115,6 +118,9 @@
 %! end_unwind_protect
 
 %!testif HAVE_OPENGL, HAVE_FLTK
+%! if (! have_window_system)
+%!  return;
+%! endif
 %! old_toolkit = graphics_toolkit ();
 %! switch (old_toolkit)
 %!   case {"gnuplot"}