changeset 23367:3054a57a47ed

* __opengl_info__.m: Use pause instead of drawnow. Update tests. Reformat output.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Apr 2017 13:59:13 -0400
parents 56c59b3f9172
children b04466113212
files scripts/plot/util/__opengl_info__.m
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/__opengl_info__.m	Fri Apr 07 09:45:32 2017 -0700
+++ b/scripts/plot/util/__opengl_info__.m	Fri Apr 07 13:59:13 2017 -0400
@@ -61,10 +61,10 @@
     warning (msg);
   else
     if (nargout == 0)
-      printf ("version    = %s\n", info.version);
-      printf ("vendor     = %s\n", info.vendor);
-      printf ("renderer   = %s\n", info.renderer);
-      printf ("extensions =\n");
+      printf ("   version: %s\n", info.version);
+      printf ("    vendor: %s\n", info.vendor);
+      printf ("  renderer: %s\n", info.renderer);
+      printf ("extensions:\n");
       printf ("  %s\n", info.extensions{:});
     else
       retval = info;
@@ -109,7 +109,8 @@
     ## Need to create a figure, place an OpenGL object, and force drawing.
     h = figure ("position", [0,0,1,1], "toolbar", "none", "menubar", "none");
     hax = axes ();
-    drawnow ();
+    ## Hmm, drawnow did not seem to be working as intended here.
+    pause (0.2);
     info = fig_gl_info (h);
     close (h);
   endif
@@ -121,7 +122,17 @@
 endfunction
 
 
-%!xtest
+## Duplicate the test since there is currently no way to write
+## "HAVE_OPENGL && (HAVE_FLTK || HAVE_QT)"
+
+%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system
 %! a = __opengl_info__ ();
 %! assert (! isempty (a))
 %! assert (isfield (a, "version"))
+
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system
+%! a = __opengl_info__ ();
+%! assert (! isempty (a))
+%! assert (isfield (a, "version"))
+
+%!error __opengl_info ("foobar")