changeset 22191:8971508e21c8

make figures invisible in publish tests (bug #48556) * publish.tst: Set default figure visibility off for the duration of each test.
author John W. Eaton <jwe@octave.org>
date Thu, 28 Jul 2016 16:38:37 -0400
parents e68128601f5e
children 20b225a3ebf8
files test/publish/publish.tst
diffstat 1 files changed, 30 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/test/publish/publish.tst	Thu Jul 28 16:07:11 2016 -0400
+++ b/test/publish/publish.tst	Thu Jul 28 16:38:37 2016 -0400
@@ -1,23 +1,35 @@
 ## publish
 
-%!testif HAVE_X_WINDOWS
-%! cases = dir ("test_script*.m");
-%! cases = strsplit (strrep ([cases.name], ".m", ".m\n"));
-%! for i = 1:length(cases)-1
-%!   publish (cases{i});
-%! endfor
-%! confirm_recursive_rmdir (false, "local");
-%! rmdir ("html", "s");
+%!test
+%! visibility = get (0, "defaultfigurevisible");
+%! unwind_protect
+%!   set (0, "defaultfigurevisible", "off");
+%!   cases = dir ("test_script*.m");
+%!   cases = strsplit (strrep ([cases.name], ".m", ".m\n"));
+%!   for i = 1:length(cases)-1
+%!     publish (cases{i});
+%!   endfor
+%!   confirm_recursive_rmdir (false, "local");
+%!   rmdir ("html", "s");
+%! unwind_protect_cleanup
+%!   set (0, "defaultfigurevisible", visibility);
+%! end_unwind_protect
 
 ## grabcode
 
-%!testif HAVE_X_WINDOWS
-%! publish ("test_script.m");
-%! str1 = fileread ("test_script.m");
-%! str2 = grabcode ("html/test_script.html");
-%! confirm_recursive_rmdir (false, "local");
-%! rmdir ("html", "s");
-%! # Canonicalize strings
-%! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n");
-%! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n");
-%! assert (hash ("md5", str1), hash ("md5", str2));
\ No newline at end of file
+%!test
+%! visibility = get (0, "defaultfigurevisible");
+%! unwind_protect
+%!   set (0, "defaultfigurevisible", "off");
+%!   publish ("test_script.m");
+%!   str1 = fileread ("test_script.m");
+%!   str2 = grabcode ("html/test_script.html");
+%!   confirm_recursive_rmdir (false, "local");
+%!   rmdir ("html", "s");
+%!   # Canonicalize strings
+%!   str1 = strjoin (deblank (strsplit (str1, "\n")), "\n");
+%!   str2 = strjoin (deblank (strsplit (str2, "\n")), "\n");
+%!   assert (hash ("md5", str1), hash ("md5", str2));
+%! unwind_protect_cleanup
+%!   set (0, "defaultfigurevisible", visibility);
+%! end_unwind_protect