Skip to content

Commit 4711e1e

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

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

buildfile.m

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

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

1721
if ~isMATLABReleaseOlderThan("R2023b")
1822
plan("clean") = matlab.buildtool.tasks.CleanTask;
@@ -38,7 +42,7 @@
3842
plan("test:main") = matlab.buildtool.tasks.TestTask(...
3943
test_root, Description="Test non-MEX targets",...
4044
Selector=cnomex, ...
41-
SourceFiles=pkg_root, RunOnlyImpactedTests=true,...
45+
SourceFiles=pkg_root, RunOnlyImpactedTests=mt_ok,...
4246
TestResults="release/TestResults_nomex.xml", Strict=true);
4347

4448
end
@@ -63,8 +67,8 @@
6367
Tag = "java_exe", Dependencies="exe", ...
6468
TestResults="release/TestResults_java_exe.xml", Strict=true);
6569

66-
addons = matlab.addons.installedAddons;
67-
if any(ismember(addons.Name, "MATLAB Test"))
70+
71+
if mt_ok
6872
plan("coverage") = matlab.buildtool.tasks.TestTask(test_root, ...
6973
Description="code coverage", ...
7074
Dependencies="exe", ...

0 commit comments

Comments
 (0)