|
2 | 2 |
|
3 | 3 | properties |
4 | 4 | CI = getenv("CI") == "true" || getenv("GITHUB_ACTIONS") == "true" |
| 5 | +cwd |
| 6 | +root |
5 | 7 | end |
6 | 8 |
|
7 | 9 | properties (TestParameter) |
|
14 | 16 |
|
15 | 17 | methods(TestClassSetup) |
16 | 18 | function pkg_path(tc) |
17 | | -p = matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath')))); |
| 19 | +tc.cwd = fileparts(mfilename('fullpath')); |
| 20 | +tc.root = fileparts(tc.cwd); |
| 21 | +p = matlab.unittest.fixtures.PathFixture(tc.root); |
18 | 22 | tc.applyFixture(p) |
19 | 23 | end |
20 | 24 | end |
21 | 25 |
|
22 | 26 |
|
23 | 27 | methods (Test, TestTags="impure") |
24 | 28 |
|
| 29 | +function test_toolbox_used(tc) |
| 30 | +[mathworksUsed, userFun] = stdlib.toolbox_used(fullfile(tc.root, "+stdlib")); |
| 31 | +Nlicense = length(mathworksUsed); |
| 32 | +txt = "stdlib for Matlab should only use builtin functions, no toolboxes"; |
| 33 | +tc.verifyEqual(Nlicense, 1, txt) |
| 34 | +tc.verifyEqual(mathworksUsed, "MATLAB") |
| 35 | +tc.verifyGreaterThan(length(userFun), 200) % we have over 200 stdlib functions |
| 36 | + |
| 37 | +[mathworksUsed, userFun] = stdlib.toolbox_used(["edge", "geodetic2ecef"]); |
| 38 | +tc.verifyEqual(userFun, string.empty) |
| 39 | +tc.verifyEqual(length(mathworksUsed), 3) |
| 40 | +end |
| 41 | + |
| 42 | +function test_all_toolboxes(tc) |
| 43 | +tc.assumeTrue(stdlib.has_java()) |
| 44 | +tbx = stdlib.allToolboxes(); |
| 45 | +tc.verifyClass(tbx, "table") |
| 46 | +end |
| 47 | + |
25 | 48 | function test_platform_tell(tc) |
26 | 49 | tc.verifyClass(stdlib.platform_tell(), 'char') |
27 | 50 | end |
|
0 commit comments