File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 7474
7575if ~isMATLABReleaseOlderThan(' R2024a' )
7676
77- plan( ' coverage ' ) = matlab .buildtool .tasks .TestTask(test_root , ...
77+ ct = matlab .buildtool .tasks .TestTask(test_root , ...
7878 Description= " Run code coverage" , ...
7979 Dependencies= ' exe' , ...
8080 SourceFiles= pkg_root , ...
8181 Strict= false );
82- plan( ' coverage ' ) .DisableIncremental = true ;
82+ ct .DisableIncremental = true ;
8383
84+ % https://www.mathworks.com/help/releases/R2025b/matlab/ref/matlab.buildtool.tasks.testtask.addcodecoverage.html
8485 coverageReport = fullfile(reportDir , ' coverage-report.html' );
85- if ~isMATLABReleaseOlderThan( ' R2024b ' ) && stdlib .checkout_license( " MATLAB Test " )
86- plan(" coverage" ).addCodeCoverage(matlabtest .plugins .codecoverage .StandaloneReport(coverageReport ));
87- else
88- plan(" coverage" ).addCodeCoverage(coverageReport );
86+ try
87+ plan(" coverage" ) = ct .addCodeCoverage(matlabtest .plugins .codecoverage .StandaloneReport(coverageReport ));
88+ catch
89+ plan(" coverage" ) = ct .addCodeCoverage(coverageReport );
8990 end
9091end
9192
You can’t perform that action at this time.
0 commit comments