Mercurial > octave-nkf
changeset 19949:d9f6260cf20a
Disable __osmesa_print__ tests on non-unix platforms (bug #44338).
* __osmesa_print__.cc: Use isunix() to verify platform before runing
BIST tests.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 07 Mar 2015 07:45:15 -0800 |
parents | 2a992bd19169 |
children | 85c5a81c6ddd |
files | libinterp/dldfcn/__osmesa_print__.cc |
diffstat | 1 files changed, 30 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__osmesa_print__.cc Fri Mar 06 07:42:13 2015 +0100 +++ b/libinterp/dldfcn/__osmesa_print__.cc Sat Mar 07 07:45:15 2015 -0800 @@ -258,29 +258,37 @@ } /* +## FIXME: osmesa does not work correctly on Windows platforms. +## This is not critical, since this facility will mostly be used in +## the future for generating the images in Octave's own documentation. +## For the moment, disable these tests on PC's and Macs. %!testif HAVE_OSMESA -%! h = figure ("visible", "off"); -%! fn = tempname (); -%! sombrero (); -%! __osmesa_print__ (h, fn, "svg"); -%! assert (stat (fn).size, 2692270, -0.1); -%! unlink (fn); -%! img = __osmesa_print__ (h); -%! assert (size (img), [get(h, "position")([4, 3]), 3]) -%! ## Use pixel sum per RGB channel as fingerprint -%! img_fp = squeeze (sum (sum (img), 2)); -%! assert (img_fp, [52942515; 54167797; 56158178], -0.05); +%! if (isunix ()) +%! h = figure ("visible", "off"); +%! fn = tempname (); +%! sombrero (); +%! __osmesa_print__ (h, fn, "svg"); +%! assert (stat (fn).size, 2692270, -0.1); +%! unlink (fn); +%! img = __osmesa_print__ (h); +%! assert (size (img), [get(h, "position")([4, 3]), 3]) +%! ## Use pixel sum per RGB channel as fingerprint +%! img_fp = squeeze (sum (sum (img), 2)); +%! assert (img_fp, [52942515; 54167797; 56158178], -0.05); +%! endif %!testif HAVE_OSMESA -%! h = figure ("visible", "off"); -%! fn = tempname (); -%! plot (sin (0:0.1:2*pi)); -%! __osmesa_print__ (h, fn, "svgis2d"); -%! assert (stat (fn).size, 7438, -0.05); -%! unlink (fn); -%! img = __osmesa_print__ (h); -%! assert (size (img), [get(h, "position")([4, 3]), 3]) -%! ## Use pixel sum per RGB channel as fingerprint -%! img_fp = squeeze (sum (sum (img), 2)); -%! assert (img_fp, [59281711; 59281711; 59482179], -0.05); +%! if (isunix ()) +%! h = figure ("visible", "off"); +%! fn = tempname (); +%! plot (sin (0:0.1:2*pi)); +%! __osmesa_print__ (h, fn, "svgis2d"); +%! assert (stat (fn).size, 7438, -0.05); +%! unlink (fn); +%! img = __osmesa_print__ (h); +%! assert (size (img), [get(h, "position")([4, 3]), 3]) +%! ## Use pixel sum per RGB channel as fingerprint +%! img_fp = squeeze (sum (sum (img), 2)); +%! assert (img_fp, [59281711; 59281711; 59482179], -0.05); +%! endif */