forked from gemini3d/mat_gemini
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestGemini.m
More file actions
31 lines (23 loc) · 1008 Bytes
/
Copy pathTestGemini.m
File metadata and controls
31 lines (23 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% this script is run on Azure (or local)
import matlab.unittest.constraints.ContainsSubstring
import matlab.unittest.selectors.HasName
import matlab.unittest.TestRunner
import matlab.unittest.Verbosity
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.XMLPlugin
import matlab.unittest.plugins.codecoverage.CoberturaFormat
name = "gemini3d.tests";
suite = testsuite(name);
suite = suite.selectIf(HasName(~ContainsSubstring('Compare')));
% we omit the external parameter only Compare test, as it's for direct user
% use only
runner = TestRunner.withTextOutput('OutputDetail', Verbosity.Detailed);
if getenv("CI") == "true"
mkdir('code-coverage');
mkdir('test-results');
runner.addPlugin(XMLPlugin.producingJUnitFormat('test-results/results.xml'));
runner.addPlugin(CodeCoveragePlugin.forPackage(name, 'Producing', CoberturaFormat('code-coverage/coverage.xml')));
end
results = runner.run(suite);
assert(~isempty(results), "no tests found")
assertSuccess(results)