# HG changeset patch # User Markus Mützel # Date 1547918568 -3600 # Node ID ada14ef3067feca546cf8dc2543e924b58ae6165 # Parent ab06235daf339d842776b0f7f6c9bdf8a5d16691 Run tests with graphics toolkit fltk only if it is available (bug #54169). * graphics.cc, uimenu.m, allchild.m, findall.m, graphics_toolkit.m: Check if "fltk" is among the available graphics toolkits for the specific tests. diff -r ab06235daf33 -r ada14ef3067f libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sun Jun 24 20:34:11 2018 +0200 +++ b/libinterp/corefcn/graphics.cc Sat Jan 19 18:22:48 2019 +0100 @@ -5082,7 +5082,7 @@ } /* -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! unwind_protect @@ -5102,7 +5102,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! fpos = get (hf, "position"); @@ -5122,7 +5122,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off"); %! graphics_toolkit (hf, "fltk"); %! fpos = get (hf, "position"); @@ -11834,7 +11834,7 @@ %! setappdata (gcbf (), "cb_exec", [getappdata(gcbf (), "cb_exec") h]); %!endfunction %! -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! hf = figure ("visible", "off", "resizefcn", @cb); %! unwind_protect %! ## Default diff -r ab06235daf33 -r ada14ef3067f scripts/gui/uimenu.m --- a/scripts/gui/uimenu.m Sun Jun 24 20:34:11 2018 +0200 +++ b/scripts/gui/uimenu.m Sat Jan 19 18:22:48 2019 +0100 @@ -106,7 +106,7 @@ %! uimenu (f, 'label', 'Close', 'accelerator', 'q', 'callback', 'close (gcf)'); %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)'); -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect @@ -123,7 +123,7 @@ %! end_unwind_protect ## check for top level menus file and edit -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect @@ -136,7 +136,7 @@ %! graphics_toolkit (toolkit); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ab06235daf33 -r ada14ef3067f scripts/plot/util/allchild.m --- a/scripts/plot/util/allchild.m Sun Jun 24 20:34:11 2018 +0200 +++ b/scripts/plot/util/allchild.m Sat Jan 19 18:22:48 2019 +0100 @@ -48,7 +48,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ab06235daf33 -r ada14ef3067f scripts/plot/util/findall.m --- a/scripts/plot/util/findall.m Sun Jun 24 20:34:11 2018 +0200 +++ b/scripts/plot/util/findall.m Sat Jan 19 18:22:48 2019 +0100 @@ -50,7 +50,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! toolkit = graphics_toolkit ("fltk"); %! hf = figure ("visible", "off"); %! unwind_protect diff -r ab06235daf33 -r ada14ef3067f scripts/plot/util/graphics_toolkit.m --- a/scripts/plot/util/graphics_toolkit.m Sun Jun 24 20:34:11 2018 +0200 +++ b/scripts/plot/util/graphics_toolkit.m Sat Jan 19 18:22:48 2019 +0100 @@ -103,7 +103,7 @@ endfunction -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ())) %! unwind_protect %! hf = figure ("visible", "off"); %! toolkit = graphics_toolkit (); @@ -114,7 +114,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) +%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) && any (strcmp ("fltk", available_graphics_toolkits ())) %! old_toolkit = graphics_toolkit (); %! switch (old_toolkit) %! case {"gnuplot"}