Skip to content

Commit 81f8cb9

Browse files
committed
check license exists before checkout
1 parent e2a5ffe commit 81f8cb9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

+stdlib/checkout_license.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
% https://www.mathworks.com/help/matlab/matlab_env/index-of-code-analyzer-checks.html
3030
featureName = string(com.mathworks.product.util.ProductIdentifier.get(name).getFlexName()); %#ok<JAPIMATHWORKS>
3131

32-
ok = license('checkout', featureName);
32+
if license('test', featureName)
33+
ok = license('checkout', featureName);
34+
end
3335

3436
end

buildfile.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@
6464
Tag = "java_exe", Dependencies="exe", Strict=true);
6565

6666
coverageReport = fullfile(reportDir, 'coverage-report.html');
67-
if isempty(license('inuse', 'MATLAB_Test'))
68-
cvg = coverageReport;
69-
else
67+
mt_name = 'MATLAB_Test';
68+
if license('test', mt_name) && ~isempty(license('inuse', mt_name))
7069
cvg = @() matlabtest.plugins.codecoverage.StandaloneReport(coverageReport);
70+
else
71+
cvg = coverageReport;
7172
end
7273

7374
plan("coverage") = matlab.buildtool.tasks.TestTask(test_root, ...

0 commit comments

Comments
 (0)