Mercurial > octave
comparison test/publish/publish.tst @ 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 | b6f482e29afd |
children | 4560273d100c |
comparison
equal
deleted
inserted
replaced
22190:e68128601f5e | 22191:8971508e21c8 |
---|---|
1 ## publish | 1 ## publish |
2 | 2 |
3 %!testif HAVE_X_WINDOWS | 3 %!test |
4 %! cases = dir ("test_script*.m"); | 4 %! visibility = get (0, "defaultfigurevisible"); |
5 %! cases = strsplit (strrep ([cases.name], ".m", ".m\n")); | 5 %! unwind_protect |
6 %! for i = 1:length(cases)-1 | 6 %! set (0, "defaultfigurevisible", "off"); |
7 %! publish (cases{i}); | 7 %! cases = dir ("test_script*.m"); |
8 %! endfor | 8 %! cases = strsplit (strrep ([cases.name], ".m", ".m\n")); |
9 %! confirm_recursive_rmdir (false, "local"); | 9 %! for i = 1:length(cases)-1 |
10 %! rmdir ("html", "s"); | 10 %! publish (cases{i}); |
11 %! endfor | |
12 %! confirm_recursive_rmdir (false, "local"); | |
13 %! rmdir ("html", "s"); | |
14 %! unwind_protect_cleanup | |
15 %! set (0, "defaultfigurevisible", visibility); | |
16 %! end_unwind_protect | |
11 | 17 |
12 ## grabcode | 18 ## grabcode |
13 | 19 |
14 %!testif HAVE_X_WINDOWS | 20 %!test |
15 %! publish ("test_script.m"); | 21 %! visibility = get (0, "defaultfigurevisible"); |
16 %! str1 = fileread ("test_script.m"); | 22 %! unwind_protect |
17 %! str2 = grabcode ("html/test_script.html"); | 23 %! set (0, "defaultfigurevisible", "off"); |
18 %! confirm_recursive_rmdir (false, "local"); | 24 %! publish ("test_script.m"); |
19 %! rmdir ("html", "s"); | 25 %! str1 = fileread ("test_script.m"); |
20 %! # Canonicalize strings | 26 %! str2 = grabcode ("html/test_script.html"); |
21 %! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n"); | 27 %! confirm_recursive_rmdir (false, "local"); |
22 %! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n"); | 28 %! rmdir ("html", "s"); |
23 %! assert (hash ("md5", str1), hash ("md5", str2)); | 29 %! # Canonicalize strings |
30 %! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n"); | |
31 %! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n"); | |
32 %! assert (hash ("md5", str1), hash ("md5", str2)); | |
33 %! unwind_protect_cleanup | |
34 %! set (0, "defaultfigurevisible", visibility); | |
35 %! end_unwind_protect |