0001
0002
0003
0004 import matlab.unittest.TestSuite
0005 import matlab.unittest.TestRunner
0006 import matlab.unittest.selectors.HasTag
0007 import matlab.unittest.plugins.CodeCoveragePlugin
0008 import edu.stanford.covert.test.Coverage
0009
0010
0011 fullSuite = TestSuite.fromPackage('dsUnit');
0012 fullSuite = fullSuite.selectIf(~HasTag('query'));
0013
0014
0015 runner = TestRunner.withTextOutput;
0016 runner.addPlugin(CodeCoveragePlugin.forFolder(fullfile(dsGetConfig('ds_root_path'), 'functions')))
0017 runner.addPlugin(CodeCoveragePlugin.forPackage('ds'))
0018
0019
0020
0021 result = runner.run(fullSuite);
0022
0023
0024
0025
0026
0027
0028 testCoverageDir = fullfile(dsGetConfig('ds_root_path'), 'testCoverage');
0029 mkdirSilent(testCoverageDir)
0030 reportPath = fullfile(testCoverageDir, 'dsAllTestCoverage.xml');
0031 report = Coverage( fullfile(dsGetConfig('ds_root_path'), 'functions') );
0032 report.exportXML(reportPath);