-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunAllTests.m
More file actions
21 lines (15 loc) · 813 Bytes
/
Copy pathrunAllTests.m
File metadata and controls
21 lines (15 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import matlab.unittest.TestRunner;
import matlab.unittest.Verbosity;
import matlab.unittest.plugins.XMLPlugin;
import matlab.unittest.plugins.CodeCoveragePlugin;
import matlab.unittest.plugins.codecoverage.CoverageReport
addpath(genpath('src'));
suite = testsuite(pwd, 'IncludeSubfolders', true);
[~,~] = mkdir('matlabTestArtifacts');
runner = TestRunner.withTextOutput('OutputDetail', Verbosity.Detailed );
runner.addPlugin(XMLPlugin.producingJUnitFormat('matlabTestArtifacts/junittestresults.xml'));
runner.addPlugin(CodeCoveragePlugin.forFolder({'src/folderA', 'src/folderB'}, 'IncludingSubfolders', true, 'Producing', CoverageReport('covReport', ...
'MainFile','index.html')));
results = runner.run(suite);
nfailed = nnz([results.Failed]);
assert(nfailed == 0, [num2str(nfailed) ' test(s) failed.']);