File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,30 @@ function testTask(~)
16
16
assertSuccess(r )
17
17
end
18
18
19
+ function coverageTask(~)
20
+ import matlab .unittest .TestRunner ;
21
+ import matlab .unittest .Verbosity ;
22
+ import matlab .unittest .plugins .CodeCoveragePlugin ;
23
+ import matlab .unittest .plugins .XMLPlugin ;
24
+ import matlab .unittest .plugins .codecoverage .CoberturaFormat ;
25
+
26
+ name = " matmap3d" ;
27
+
28
+ suite = testsuite(name );
29
+
30
+ mkdir(' code-coverage' );
31
+ mkdir(' test-results' );
32
+
33
+ runner = TestRunner .withTextOutput();
34
+ runner .addPlugin(XMLPlugin .producingJUnitFormat(' test-results/results.xml' ));
35
+ runner .addPlugin(CodeCoveragePlugin .forPackage(name , ' Producing' , CoberturaFormat(' code-coverage/coverage.xml' )));
36
+
37
+ results = runner .run(suite );
38
+ assert(~isempty(results ), " no tests found" )
39
+
40
+ assertSuccess(results )
41
+ end
42
+
19
43
function publishTask(~)
20
44
% publish (generate) docs from Matlab project
21
45
You can’t perform that action at this time.
0 commit comments