Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit b0dd8ff

Browse files
authored
Merge pull request #25 from mathworks/CI_324_testrun_support_for_r13a
testsuite support for MATLAB version less than R2016a
2 parents fe8b723 + f0f6363 commit b0dd8ff

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/main/resources/com/mathworks/ci/MatlabBuilder/runMatlabTests.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
error('MATLAB:unitTest:testFrameWorkNotSupported','Running tests automatically is not supported in this relase.');
99
end
1010

11-
import('matlab.unittest.TestRunner');
12-
import('matlab.unittest.TestSuite');
13-
1411
%Create test suite for tests folder
15-
suite = testsuite(pwd,'IncludeSubfolders',true);
12+
suite = getTestSuite();
1613

1714
% Create and configure the runner
18-
runner = TestRunner.withTextOutput('Verbosity',3);
15+
import('matlab.unittest.TestRunner');
16+
runner = TestRunner.withTextOutput;
1917

2018
% Add the requested plugins
2119
resultsDir = fullfile(pwd, 'matlabTestArtifacts');
@@ -80,6 +78,15 @@
8078
fclose(fopen(tapFile,'w'));
8179
tapToFile = matlab.unittest.plugins.ToFile(tapFile);
8280

81+
function suite = getTestSuite()
82+
import('matlab.unittest.TestSuite');
83+
BASE_VERSION_TESTSUITE_SUPPORT = '9.0';
84+
if verLessThan('matlab',BASE_VERSION_TESTSUITE_SUPPORT)
85+
suite = matlab.unittest.TestSuite.fromFolder(pwd,'IncludingSubfolders',true);
86+
else
87+
suite = testsuite(pwd,'IncludeSubfolders',true);
88+
end
89+
8390

8491
function mkdirIfNeeded(dir)
8592
if exist(dir,'dir') ~= 7

0 commit comments

Comments
 (0)