|
4 | 4 |
|
5 | 5 | addpath(plan.RootFolder) |
6 | 6 |
|
7 | | -pkg_name = "+matmap3d"; |
| 7 | +if ~isMATLABReleaseOlderThan("R2024a") |
| 8 | + plan("coverage") = matlab.buildtool.tasks.TestTask(Description="code coverage", SourceFiles="test", Strict=false, CodeCoverageResults="code-coverage.xml"); |
| 9 | +end |
8 | 10 |
|
9 | | -if ~isMATLABReleaseOlderThan("R2023b") |
10 | | - plan("check") = matlab.buildtool.tasks.CodeIssuesTask(pkg_name, IncludeSubfolders=true, WarningThreshold=0); |
11 | | - plan("test") = matlab.buildtool.tasks.TestTask("test", Strict=false); |
12 | 11 | end |
13 | 12 |
|
14 | | -if ~isMATLABReleaseOlderThan("R2024a") |
15 | | - plan("coverage") = matlab.buildtool.tasks.TestTask(Description="code coverage", SourceFiles="test", Strict=false, CodeCoverageResults="code-coverage.xml"); |
| 13 | + |
| 14 | +function testTask(context) |
| 15 | +r = runtests(fullfile(context.Plan.RootFolder, "test"), Strict=false); |
| 16 | +% Parallel Computing Toolbox takes more time to startup than is worth it for this task |
| 17 | + |
| 18 | +assert(~isempty(r), "No tests were run") |
| 19 | +assertSuccess(r) |
| 20 | +end |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +function checkTask(context) |
| 25 | +root = context.Plan.RootFolder; |
| 26 | + |
| 27 | +c = codeIssues(root, IncludeSubfolders=true); |
| 28 | + |
| 29 | +if isempty(c.Issues) |
| 30 | + fprintf('%d files checked OK with %s under %s\n', numel(c.Files), c.Release, root) |
| 31 | +else |
| 32 | + disp(c.Issues) |
| 33 | + error("Errors found in " + join(c.Issues.Location, newline)) |
16 | 34 | end |
17 | 35 |
|
18 | 36 | end |
19 | 37 |
|
20 | 38 |
|
21 | 39 | function publishTask(context) |
22 | | -% publish HTML inline documentation strings to individual HTML files |
23 | | -outdir = fullfile(context.Plan.RootFolder, 'docs'); |
| 40 | +outdir = fullfile(context.Plan.RootFolder, "docs"); |
24 | 41 |
|
25 | 42 | publish_gen_index_html("matmap3d", ... |
26 | 43 | "Geographic coordinate tranformation functions for Matlab.", ... |
|
0 commit comments