Mercurial > octave
annotate test/mk-conv-tst.sh @ 31191:bb9d776eafac stable
Fix wrong color in PDF printout of some latex strings (bug #62884)
* octave-svgconvert (draw): For "rect" elements only set brush color if
necessary and eventually restore to previous color.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Sun, 14 Aug 2022 18:24:07 +0200 |
parents | 95725e6ad9c1 |
children | 597f3ee61a48 |
rev | line source |
---|---|
22284 | 1 #!/bin/sh |
2 | |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
3 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 ## |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29982
diff
changeset
|
5 ## Copyright (C) 2016-2022 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
6 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 ## distribution or <https://octave.org/copyright/>. |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
9 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
10 ## This file is part of Octave. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
11 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23710
diff
changeset
|
12 ## Octave is free software: you can redistribute it and/or modify it |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
13 ## 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:
23710
diff
changeset
|
14 ## the Free Software Foundation, either version 3 of the License, or |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
15 ## (at your option) any later version. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
16 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
17 ## Octave is distributed in the hope that it will be useful, but |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
18 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
19 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
20 ## GNU General Public License for more details. |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
21 ## |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
22 ## You should have received a copy of the GNU General Public License |
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
23 ## 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:
23710
diff
changeset
|
24 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
25 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
26 ######################################################################## |
22799
592fa741e0aa
add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents:
22324
diff
changeset
|
27 |
22284 | 28 cat <<EOF |
29 ## !!! DO NOT EDIT !!! | |
30 ## THIS IS AN AUTOMATICALLY GENERATED FILE | |
28629
af361aea02e0
allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
31 ## modify mk-conv-tst.sh to generate the tests you need. |
22284 | 32 |
33 | |
34 %!shared r,dq,sq,b,bm,dm,cdm,fdm,fcdm,pm,sm,sbm,scm,s,m,cs,cm,fs,fm,fcs,fcm,i8s,i16s,i32s,i64s,i8m,i16m,i32m,i64m,ui8s,ui16s,ui32s,ui64s,ui8m,ui16m,ui32m,ui64m | |
35 %!test | |
36 %! r = 1:5; | |
37 %! dq = "foo"; | |
38 %! sq = 'bar'; | |
39 %! b = true; | |
40 %! bm = rand (5) > 0.5; | |
41 %! dm = eye (5); | |
42 %! cdm = eye (5) * i; | |
43 %! fdm = eye (5, "single"); | |
44 %! fcdm = eye (5, "single") * single (i); | |
45 %! [~, ~, pm] = qr (rand (5)); | |
46 %! sm = sprand (5, 5, 0.1); | |
47 %! sbm = sparse (rand (5) > 0.5); | |
48 %! scm = sprand (5, 5, 0.1) * i; | |
49 %! s = rand (); | |
50 %! m = rand (5); | |
51 %! cs = 13 * i; | |
52 %! cm = rand (5) * i; | |
53 %! fs = rand ("single"); | |
54 %! fm = rand (5, "single"); | |
55 %! fcs = rand ("single") * single (i); | |
56 %! fcm = rand (5, "single") * single (i); | |
57 %! i8s = int8 (rand () * 10); | |
58 %! i16s = int16 (rand () * 10); | |
59 %! i32s = int32 (rand () * 10); | |
60 %! i64s = int64 (rand () * 10); | |
61 %! i8m = int8 (rand (5) * 10); | |
62 %! i16m = int16 (rand (5) * 10); | |
63 %! i32m = int32 (rand (5) * 10); | |
64 %! i64m = int64 (rand (5) * 10); | |
65 %! ui8s = uint8 (rand () * 10); | |
66 %! ui16s = uint16 (rand () * 10); | |
67 %! ui32s = uint32 (rand () * 10); | |
68 %! ui64s = uint64 (rand () * 10); | |
69 %! ui8m = uint8 (rand (5) * 10); | |
70 %! ui16m = uint16 (rand (5) * 10); | |
71 %! ui32m = uint32 (rand (5) * 10); | |
72 %! ui64m = uint64 (rand (5) * 10); | |
22324
6d54ecbfb50a
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22284
diff
changeset
|
73 %! |
28629
af361aea02e0
allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
74 %!test |
29982
605275522c37
Deprecate disable_range, disable_diagonal_matrix, disable_permutation_matrix.
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
75 %! if (optimize_range ()) |
30852
95725e6ad9c1
restore part of the old octave_range class as octave_legacy_range
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
76 %! assert (typeinfo (r), "double_range") |
29982
605275522c37
Deprecate disable_range, disable_diagonal_matrix, disable_permutation_matrix.
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
77 %! else |
28629
af361aea02e0
allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
78 %! assert (typeinfo (r), "matrix") |
af361aea02e0
allow tests to work when disable_range is true
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
79 %! endif |
22284 | 80 %!assert (typeinfo (dq), "string") |
81 %!assert (typeinfo (sq), "sq_string") | |
82 %!assert (typeinfo (b), "bool") | |
83 %!assert (typeinfo (bm), "bool matrix") | |
84 %!assert (typeinfo (dm), "diagonal matrix") | |
85 %!assert (typeinfo (cdm), "complex diagonal matrix") | |
86 %!assert (typeinfo (fdm), "float diagonal matrix") | |
87 %!assert (typeinfo (fcdm), "float complex diagonal matrix") | |
88 %!assert (typeinfo (pm), "permutation matrix") | |
89 %!assert (typeinfo (sm), "sparse matrix") | |
90 %!assert (typeinfo (sbm), "sparse bool matrix") | |
91 %!assert (typeinfo (scm), "sparse complex matrix") | |
92 %!assert (typeinfo (s), "scalar") | |
93 %!assert (typeinfo (m), "matrix") | |
94 %!assert (typeinfo (cs), "complex scalar") | |
95 %!assert (typeinfo (cm), "complex matrix") | |
96 %!assert (typeinfo (fs), "float scalar") | |
97 %!assert (typeinfo (fm), "float matrix") | |
98 %!assert (typeinfo (fcs), "float complex scalar") | |
99 %!assert (typeinfo (fcm), "float complex matrix") | |
100 %!assert (typeinfo (i8s), "int8 scalar") | |
101 %!assert (typeinfo (i16s), "int16 scalar") | |
102 %!assert (typeinfo (i32s), "int32 scalar") | |
103 %!assert (typeinfo (i64s), "int64 scalar") | |
104 %!assert (typeinfo (i8m), "int8 matrix") | |
105 %!assert (typeinfo (i16m), "int16 matrix") | |
106 %!assert (typeinfo (i32m), "int32 matrix") | |
107 %!assert (typeinfo (i64m), "int64 matrix") | |
108 %!assert (typeinfo (ui8s), "uint8 scalar") | |
109 %!assert (typeinfo (ui16s), "uint16 scalar") | |
110 %!assert (typeinfo (ui32s), "uint32 scalar") | |
111 %!assert (typeinfo (ui64s), "uint64 scalar") | |
112 %!assert (typeinfo (ui8m), "uint8 matrix") | |
113 %!assert (typeinfo (ui16m), "uint16 matrix") | |
114 %!assert (typeinfo (ui32m), "uint32 matrix") | |
115 %!assert (typeinfo (ui64m), "uint64 matrix") | |
116 %! | |
117 %!assert (class (r), "double") | |
118 %!assert (class (dq), "char") | |
119 %!assert (class (sq), "char") | |
120 %!assert (class (b), "logical") | |
121 %!assert (class (bm), "logical") | |
122 %!assert (class (dm), "double") | |
123 %!assert (class (cdm), "double") | |
124 %!assert (class (fdm), "single") | |
125 %!assert (class (fcdm), "single") | |
126 %!assert (class (pm), "double") | |
127 %!assert (class (sm), "double") | |
128 %!assert (class (sbm), "logical") | |
129 %!assert (class (scm), "double") | |
130 %!assert (class (s), "double") | |
131 %!assert (class (m), "double") | |
132 %!assert (class (cs), "double") | |
133 %!assert (class (cm), "double") | |
134 %!assert (class (fs), "single") | |
135 %!assert (class (fm), "single") | |
136 %!assert (class (fcs), "single") | |
137 %!assert (class (fcm), "single") | |
138 %!assert (class (i8s), "int8") | |
139 %!assert (class (i16s), "int16") | |
140 %!assert (class (i32s), "int32") | |
141 %!assert (class (i64s), "int64") | |
142 %!assert (class (i8m), "int8") | |
143 %!assert (class (i16m), "int16") | |
144 %!assert (class (i32m), "int32") | |
145 %!assert (class (i64m), "int64") | |
146 %!assert (class (ui8s), "uint8") | |
147 %!assert (class (ui16s), "uint16") | |
148 %!assert (class (ui32s), "uint32") | |
149 %!assert (class (ui64s), "uint64") | |
150 %!assert (class (ui8m), "uint8") | |
151 %!assert (class (ui16m), "uint16") | |
152 %!assert (class (ui32m), "uint32") | |
153 %!assert (class (ui64m), "uint64") | |
154 EOF | |
155 | |
156 ## There are no single or integer sparse matrices. | |
157 | |
158 sparse_vars="sm sbm scm" | |
159 sparse_conversions="double logical" | |
160 | |
161 for c in $sparse_conversions; do | |
162 echo "" | |
163 for v in $sparse_vars; do | |
164 echo "%!assert (class ($c ($v)), \"$c\")" | |
165 done | |
166 done | |
167 | |
168 char_vars="dq sq" | |
169 bool_vars="b bm" | |
170 real_vars="r s m fs fm dm fdm pm" | |
171 complex_vars="cs cm fcs fcm cdm fcdm" | |
172 signed_int_vars="i8s i16s i32s i64s i8m i16m i32m i64m" | |
173 unsigned_int_vars="ui8s ui16s ui32s ui64s ui8m ui16m ui32m ui64m" | |
174 int_vars="$signed_int_vars $unsigned_int_vars" | |
175 | |
176 bool_conversions="logical" | |
177 float_conversions="double single" | |
178 int_conversions="int8 int16 int32 int64 uint8 uint16 uint32 uint64" | |
179 all_conversions="$bool_conversions $float_conversions $int_conversions" | |
180 | |
181 ## Strings can't be converted to logical. | |
182 | |
183 for v in $char_vars; do | |
184 echo "" | |
185 for c in $float_conversions $int_conversions; do | |
186 echo "%!assert (class ($c ($v)), \"$c\")" | |
187 done | |
188 done | |
189 | |
190 ## Octave doesn't have complex integers. | |
191 | |
192 for v in $complex_vars; do | |
193 echo "" | |
194 for c in $bool_conversions $float_conversions; do | |
195 echo "%!assert (class ($c ($v)), \"$c\")" | |
196 done | |
197 done | |
198 | |
199 ## Logical and real-value numeric values should be convertible to any | |
200 ## double, single, logical or integer type. | |
201 | |
202 for v in $bool_vars $real_vars $int_vars; do | |
203 echo "" | |
204 for c in $all_conversions; do | |
205 echo "%!assert (class ($c ($v)), \"$c\")" | |
206 done | |
207 done |