Home > functions > internal > unit-test > dsUnitRun_all.m

dsUnitRun_all

PURPOSE ^

% Run all tests

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Run all tests
 excluding query tests

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Run all tests
0002 % excluding query tests
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 %% Make Test Suite
0011 fullSuite = TestSuite.fromPackage('dsUnit');
0012 fullSuite = fullSuite.selectIf(~HasTag('query'));
0013 
0014 %% code coverage runner
0015 runner = TestRunner.withTextOutput;
0016 runner.addPlugin(CodeCoveragePlugin.forFolder(fullfile(dsGetConfig('ds_root_path'), 'functions')))
0017 runner.addPlugin(CodeCoveragePlugin.forPackage('ds'))
0018 
0019 %% Run Test Suite
0020 % result = run(fullSuite); % test suite without code covereage or parallel
0021 result = runner.run(fullSuite); % runner for code coverage
0022 
0023 %% Run Test Suite in Parallel
0024 % runner = matlab.unittest.TestRunner.withTextOutput;
0025 % result = runInParallel(runner,fullSuite); % runner in parallel, no code coverage
0026 
0027 %% XML Coverage Output
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);

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005