annotate test/publish/publish.tst @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
1 ## Copyright (C) 2016-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27847
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27847
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27847
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27847
diff changeset
5 ##
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
6 ##
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
7 ## This file is part of Octave.
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23327
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
10 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23327
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
12 ## (at your option) any later version.
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
13 ##
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
17 ## GNU General Public License for more details.
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
18 ##
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
19 ## You should have received a copy of the GNU General Public License
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23327
diff changeset
21 ## <https://www.gnu.org/licenses/>.
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
22
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
23 ## test for publish
22113
b6f482e29afd New functions publish.m and grabcode.m (patch #9048).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
24
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
25 %!test
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
26 %! visibility = get (0, "defaultfigurevisible");
22734
4560273d100c Change publish.tst to use gnuplot on Windows platforms (bug #49501).
Rik <rik@octave.org>
parents: 22191
diff changeset
27 %! toolkit = graphics_toolkit ();
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
28 %! unwind_protect
27847
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
29 %! if (! __have_feature__ ("QT_OFFSCREEN")
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
30 %! || ! strcmp (graphics_toolkit (), "qt"))
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
31 %! try
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
32 %! graphics_toolkit ("gnuplot");
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
33 %! catch
27847
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
34 %! ## The system doesn't support gnuplot for drawing hidden
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
35 %! ## figures. Just return and have test marked as passing.
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
36 %! return;
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
37 %! end_try_catch
22734
4560273d100c Change publish.tst to use gnuplot on Windows platforms (bug #49501).
Rik <rik@octave.org>
parents: 22191
diff changeset
38 %! endif
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
39 %! set (0, "defaultfigurevisible", "off");
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
40 %!
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
41 %! scripts = dir ("test_script*.m");
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
42 %! tmpDir = tempname ();
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
43 %! mkdir (tmpDir);
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
44 %! opts.outputDir = tmpDir;
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
45 %! for fname = {scripts.name}
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
46 %! publish (fname{1}, opts);
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
47 %! endfor
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
48 %! confirm_recursive_rmdir (false, "local");
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
49 %! rmdir (tmpDir, "s");
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
50 %! unwind_protect_cleanup
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
51 %! set (0, "defaultfigurevisible", visibility);
22734
4560273d100c Change publish.tst to use gnuplot on Windows platforms (bug #49501).
Rik <rik@octave.org>
parents: 22191
diff changeset
52 %! graphics_toolkit (toolkit);
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
53 %! end_unwind_protect
22113
b6f482e29afd New functions publish.m and grabcode.m (patch #9048).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
54
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
55 ## test for grabcode
22113
b6f482e29afd New functions publish.m and grabcode.m (patch #9048).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
56
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
57 %!test
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
58 %! visibility = get (0, "defaultfigurevisible");
22734
4560273d100c Change publish.tst to use gnuplot on Windows platforms (bug #49501).
Rik <rik@octave.org>
parents: 22191
diff changeset
59 %! toolkit = graphics_toolkit ();
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
60 %! unwind_protect
27847
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
61 %! if (! __have_feature__ ("QT_OFFSCREEN")
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
62 %! || ! strcmp (graphics_toolkit (), "qt"))
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
63 %! try
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
64 %! graphics_toolkit ("gnuplot");
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
65 %! catch
27847
56d94f86a659 Don't test presence of OSMESA which will always fail (bug #57424)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 26376
diff changeset
66 %! ## The system doesn't support gnuplot for drawing hidden
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
67 %! ## figures. Just return and have test marked as passing.
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
68 %! return;
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
69 %! end_try_catch
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
70 %! endif
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
71 %! set (0, "defaultfigurevisible", "off");
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
72 %! ## Create temporary directory
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
73 %! tmpDir = tempname ();
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
74 %! mkdir (tmpDir);
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
75 %! opts.outputDir = tmpDir;
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
76 %! ## Call publish and grabcode
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
77 %! publish ("test_script.m", opts);
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
78 %! str1 = fileread ("test_script.m");
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
79 %! str2 = grabcode (fullfile (tmpDir, "test_script.html"));
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
80 %! confirm_recursive_rmdir (false, "local");
23326
71a749eeb7d3 test: publish to a temporary directory to ensure write access.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 23083
diff changeset
81 %! rmdir (tmpDir, "s");
22870
7248717d456a Don't run publish.tst unless OSMESA or gnuplot are available (bug #49767).
Rik <rik@octave.org>
parents: 22734
diff changeset
82 %! ## Canonicalize strings
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
83 %! str1 = strjoin (deblank (strsplit (str1, "\n")), "\n");
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
84 %! str2 = strjoin (deblank (strsplit (str2, "\n")), "\n");
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
85 %! assert (hash ("md5", str1), hash ("md5", str2));
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
86 %! unwind_protect_cleanup
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
87 %! set (0, "defaultfigurevisible", visibility);
22734
4560273d100c Change publish.tst to use gnuplot on Windows platforms (bug #49501).
Rik <rik@octave.org>
parents: 22191
diff changeset
88 %! graphics_toolkit (toolkit);
22191
8971508e21c8 make figures invisible in publish tests (bug #48556)
John W. Eaton <jwe@octave.org>
parents: 22113
diff changeset
89 %! end_unwind_protect