Mercurial > octave-nkf
annotate scripts/miscellaneous/license.m @ 20039:eba80000fa0d rc-4-0-0-2
maint: Bump version number for 4.0.0-rc2.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 20 Mar 2015 16:19:38 -0400 |
parents | 9fc020886ae9 |
children |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19630
diff
changeset
|
1 ## Copyright (C) 2005-2015 William Poetra Yoga Hadisoeseno |
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19630
diff
changeset
|
2 ## Copyright (C) 2014-2015 Carnë Draug |
5546 | 3 ## |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
7016 | 8 ## the Free Software Foundation; either version 3 of the License, or (at |
9 ## your option) any later version. | |
5546 | 10 ## |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
7016 | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | |
5546 | 19 |
20 ## -*- texinfo -*- | |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
21 ## @deftypefn {Command} {} license |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
22 ## @deftypefnx {Command} {} license inuse |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
23 ## @deftypefnx {Command} {} license inuse @var{feature} |
16489
36dba9be680b
doc: Make documentation compatible with Texinfo 5.0 (bug #38392)
Amod Mulay <amodmulay1@gmail.com>
parents:
15466
diff
changeset
|
24 ## @deftypefnx {Function File} {} license ("inuse") |
36dba9be680b
doc: Make documentation compatible with Texinfo 5.0 (bug #38392)
Amod Mulay <amodmulay1@gmail.com>
parents:
15466
diff
changeset
|
25 ## @deftypefnx {Function File} {@var{retval} =} license ("inuse") |
36dba9be680b
doc: Make documentation compatible with Texinfo 5.0 (bug #38392)
Amod Mulay <amodmulay1@gmail.com>
parents:
15466
diff
changeset
|
26 ## @deftypefnx {Function File} {@var{retval} =} license ("test", @var{feature}) |
36dba9be680b
doc: Make documentation compatible with Texinfo 5.0 (bug #38392)
Amod Mulay <amodmulay1@gmail.com>
parents:
15466
diff
changeset
|
27 ## @deftypefnx {Function File} {@var{retval} =} license ("checkout", @var{feature}) |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
28 ## @deftypefnx {Function File} {[@var{retval}, @var{errmsg}] =} license ("checkout", @var{feature}) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
29 ## Get license information for Octave and Octave packages. |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
30 ## |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
31 ## GNU Octave is free software distributed under the GNU General Public |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
32 ## License (GPL), and a license manager makes no sense. This function is |
19439
cbce5d1bcaf9
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
19256
diff
changeset
|
33 ## provided only for @sc{matlab} compatibility. |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
34 ## |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
35 ## When called with no extra input arguments, it returns the Octave license, |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
36 ## otherwise the first input defines the operation mode and must be one of |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
37 ## the following strings: @code{inuse}, @code{test}, and @code{checkout}. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
38 ## The optional @var{feature} argument can either be @qcode{"octave"} (core), |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
39 ## or an Octave package. |
5546 | 40 ## |
11595
5ec6aa05638d
Prevent doubled quotes around @table items in Info.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
41 ## @table @asis |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
42 ## @item @qcode{"inuse"} |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
43 ## Returns a list of loaded features, i.e., octave and the list of loaded |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
44 ## packages. If an output is requested, it returns a struct array with |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
45 ## the fields @qcode{"feature"}, and @qcode{"user"}. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
46 ## |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
47 ## @item @qcode{"test"} |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
48 ## Return true if the specified @var{feature} is installed, false otherwise. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
49 ## |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
50 ## An optional third argument @qcode{"enable"} or @qcode{"disable"} is |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
51 ## accepted but ignored. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
52 ## |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
53 ## @item @qcode{"checkout"} |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
54 ## Return true if the specified @var{feature} is installed, false otherwise. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
55 ## An optional second output will have an error message if a package is not |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
56 ## installed. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
57 ## |
5546 | 58 ## @end table |
59 ## | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
60 ## @seealso{pkg, ver, version} |
5546 | 61 ## @end deftypefn |
62 | |
63 ## Author: William Poetra Yoga Hadisoeseno <williampoetra@gmail.com> | |
64 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
65 function [retval, errmsg] = license (cmd, feature, toogle) |
5546 | 66 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
67 if (nargin > 3) |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
68 print_usage (); |
5546 | 69 endif |
70 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
71 ## Then only give information about Octave core |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
72 if (nargin == 0) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
73 retval = "GNU General Public License"; |
19256 | 74 return; |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
75 endif |
5546 | 76 |
19256 | 77 [features, loaded] = get_all_features (); |
5546 | 78 |
19256 | 79 switch (tolower (cmd)) |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
80 case "inuse" |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
81 if (nargin > 2) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
82 print_usage (); |
5546 | 83 endif |
84 | |
19256 | 85 features = features(loaded); |
5546 | 86 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
87 if (nargin > 1) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
88 features = features(strcmp (features, feature)); |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
89 endif |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
90 if (nargout == 0) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
91 printf ("%s\n", features{:}); |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
92 else |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
93 retval = struct ("feature", features, "user", get_username ()); |
5546 | 94 endif |
95 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
96 case "test" |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
97 if (nargin < 2) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
98 print_usage (); |
5546 | 99 endif |
100 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
101 if (nargin > 2) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
102 ## We ignore the toogle argument because... what's the point? We |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
103 ## don't need a license management system on Octave. This function |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
104 ## will return true, even if anyone tries to disabled a license. |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
105 switch (tolower (toogle)) |
19256 | 106 case "enable" # do nothing |
107 case "disable" # do nothing | |
108 otherwise error ("license: TOOGLE must be enable or disable"); | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
109 endswitch |
5546 | 110 endif |
111 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
112 retval = any (strcmp (features, feature)); |
5546 | 113 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
114 case "checkout" |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
115 ## I guess we could have the checkout command load packages but it's not |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
116 ## really the same thing. The closest we have is simply to check if |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
117 ## there is a package with the feature name, and give an error if not. |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
118 |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
119 if (nargin != 2) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
120 print_usage (); |
5546 | 121 endif |
122 | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
123 retval = any (strcmp (features, feature)); |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
124 errmsg = ""; |
5546 | 125 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
126 if (! retval) |
19256 | 127 errmsg = ['No package named "' feature '" installed']; |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
128 endif |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
129 |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
130 otherwise |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
131 print_usage (); |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
132 endswitch |
5546 | 133 |
134 endfunction | |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
135 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
136 function username = get_username () |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
137 pw = getpwuid (getuid ()); |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
138 if (isstruct (pw)) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
139 username = pw.name; |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
140 else |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
141 username = "octave_user"; |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
142 endif |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
143 endfunction |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
144 |
19256 | 145 function [features, loaded] = get_all_features () |
146 pkg_list = pkg ("list"); | |
147 features = {"octave", ... | |
148 cellfun(@(x) x.name, pkg_list, "uniformoutput", false){:}}; | |
149 loaded = [true, cellfun(@(x) x.loaded, pkg_list)]; | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
150 endfunction |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
151 |
19256 | 152 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
153 %!assert (license (), "GNU General Public License") |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
154 %!assert ((license ("inuse", "octave")).feature, "octave") |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
155 |
19256 | 156 %!shared list |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
157 %!test |
19256 | 158 %! list = pkg ("list"); |
159 %! for idx = 1: numel (list) | |
160 %! name = list{idx}.name; | |
161 %! if (list{idx}.loaded); | |
162 %! assert ((license ("inuse", name)).feature, name); | |
163 %! else | |
164 %! rv = license ("inuse", name); | |
165 %! assert (isstruct (rv)); | |
166 %! assert (all (isfield (rv, {"feature", "user"}))); | |
167 %! endif | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
168 %! endfor |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
169 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
170 %!assert (license ("test", "octave"), true) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
171 %!assert (license ("test", "not_a_valid package name"), false) |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
172 |
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
173 %!test |
19256 | 174 %! for idx = 1: numel (list) |
175 %! assert (license ("test", list{idx}.name), true) | |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
176 %! endfor |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
177 |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
178 %!assert (license ("checkout", "octave"), true) |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
179 |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
180 %!test |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
181 %! [s, e] = license ("checkout", "NOT_A_PACKAGE"); |
19256 | 182 %! assert (e, 'No package named "NOT_A_PACKAGE" installed'); |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
183 |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
184 ## Test input validation |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
185 %!error license ("not_inuse") |
19237
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
186 %!error license ("not_test", "octave", "enable") |
6dfce51a7b40
license.m: update to treat packages as features (bug #43154).
Carnë Draug <carandraug@octave.org>
parents:
17744
diff
changeset
|
187 %!error <TOOGLE must be enable or disable> license ("test", "octave", "invalid_toogle") |
13825
45f4ff9a6247
license.m: Update to modern coding standards. Add functional and input validation tests.
Rik <octave@nomad.inbox5.com>
parents:
12480
diff
changeset
|
188 |