Skip to content

Commit b20e500

Browse files
committed
check for Matlab Test license
1 parent 7c9dfbd commit b20e500

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

buildfile.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
pkg_root = fullfile(plan.RootFolder, "+stdlib");
1414
test_root = fullfile(plan.RootFolder, "test");
1515

16+
if isMATLABReleaseOlderThan('R2025a')
17+
mt_ok = false;
18+
else
19+
addons = matlab.addons.installedAddons;
20+
mt_ok = any(ismember(addons.Name, "MATLAB Test")) && license('checkout', 'MATLAB Test') == 1;
21+
end
1622

1723
if ~isMATLABReleaseOlderThan("R2023b")
1824
plan("clean") = matlab.buildtool.tasks.CleanTask;
@@ -38,7 +44,7 @@
3844
plan("test:main") = matlab.buildtool.tasks.TestTask(...
3945
test_root, Description="Test non-MEX targets",...
4046
Selector=cnomex, ...
41-
SourceFiles=pkg_root, RunOnlyImpactedTests=true,...
47+
SourceFiles=pkg_root, RunOnlyImpactedTests=mt_ok,...
4248
TestResults="release/TestResults_nomex.xml", Strict=true);
4349

4450
end
@@ -63,8 +69,8 @@
6369
Tag = "java_exe", Dependencies="exe", ...
6470
TestResults="release/TestResults_java_exe.xml", Strict=true);
6571

66-
addons = matlab.addons.installedAddons;
67-
if any(ismember(addons.Name, "MATLAB Test"))
72+
73+
if mt_ok
6874
plan("coverage") = matlab.buildtool.tasks.TestTask(test_root, ...
6975
Description="code coverage", ...
7076
Dependencies="exe", ...

0 commit comments

Comments
 (0)