-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ docs/ | |
resources/ | ||
*.asv | ||
*.m~ | ||
code-coverage/ | ||
test-results/ | ||
code-coverage.xml | ||
.buildtool/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,42 @@ | ||
function plan = buildfile | ||
plan = buildplan(localfunctions); | ||
|
||
plan = buildplan(); | ||
|
||
plan.DefaultTasks = "test"; | ||
plan("test").Dependencies = "check"; | ||
|
||
pkg_name = "+matmap3d"; | ||
|
||
if isMATLABReleaseOlderThan("R2023b") | ||
plan("test") = matlab.buildtool.Task(Actions=@legacyTestTask); | ||
else | ||
plan("check") = matlab.buildtool.tasks.CodeIssuesTask(pkg_name, IncludeSubfolders=true); | ||
plan("test") = matlab.buildtool.tasks.TestTask("test", Strict=false); | ||
end | ||
|
||
function checkTask(~) | ||
% Identify code issues (recursively all Matlab .m files) | ||
issues = codeIssues; | ||
assert(isempty(issues.Issues), formattedDisplayText(issues.Issues)) | ||
if ~isMATLABReleaseOlderThan("R2024a") | ||
plan("coverage") = matlab.buildtool.tasks.TestTask(Description="code coverage", SourceFiles="test", Strict=false, CodeCoverageResults="code-coverage.xml"); | ||
end | ||
|
||
function testTask(~) | ||
r = runtests(IncludeSubfolders=true, strict=true, UseParallel=true); | ||
plan("publish") = matlab.buildtool.Task(Description="HTML inline doc generate", Actions=@publishTask); | ||
|
||
|
||
assert(~isempty(r), "No tests were run") | ||
assertSuccess(r) | ||
end | ||
|
||
function coverageTask(~) | ||
cwd = fileparts(mfilename('fullpath')); | ||
|
||
coverage_run("matmap3d", fullfile(cwd, "test")) | ||
function legacyTestTask(context) | ||
r = runtests(fullfile(context.Plan.RootFolder, "test"), Strict=false); | ||
% Parallel Computing Toolbox takes more time to startup than is worth it for this task | ||
|
||
assert(~isempty(r), "No tests were run") | ||
assertSuccess(r) | ||
end | ||
|
||
function publishTask(~) | ||
cwd = fileparts(mfilename('fullpath')); | ||
outdir = fullfile(cwd, "docs"); | ||
|
||
function publishTask(context) | ||
outdir = fullfile(context.Plan.RootFolder, "docs"); | ||
|
||
publish_gen_index_html("matmap3d", ... | ||
"Geographic Map coordinate transform functions for Matlab", ... | ||
"Geographic coordinate tranformation functions for Matlab.", ... | ||
"https://github.com/geospace-code/matmap3d", ... | ||
outdir) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters