-
Notifications
You must be signed in to change notification settings - Fork 19
/
numadTest.m
45 lines (38 loc) · 1.64 KB
/
numadTest.m
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Part of the SNL NuMAD Toolbox
% Developed by Sandia National Laboratories Wind Energy Technologies
% See license.txt for disclaimer information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function results = numadTest(options)
% ``numadTest`` runs NuMAD continuous integration testing suite.
%
% results = numadTest returns a matlab.unittest.TestResult object
%
% results = numadTest(..., NAME1, VALUE1, NAME2, VALUE2, ...) returns
% a matlab.unittest.TestResult object, depending on the values of the
% optional parameter name/value pairs. See Parameters below.
%
% Parameters
% ----------
% 'exampleTest' Run tests for NuMAD examples. Default is true.
%
arguments
options.exampleTest = true
end
import matlab.unittest.TestSuite
import matlab.unittest.Test
import matlab.unittest.TestRunner
import matlab.unittest.plugins.DiagnosticsRecordingPlugin
import matlab.unittest.plugins.CodeCoveragePlugin
suites = Test.empty();
if options.exampleTest
suites = [suites TestSuite.fromFile('examples/exampleTest.m')];
end
% Create TestRunner
runner = TestRunner.withTextOutput; % Contains TestRunProgressPlugin, DiagnosticsOutputPlugin
runner.addPlugin(DiagnosticsRecordingPlugin);
runner.addPlugin(CodeCoveragePlugin.forFolder('./source','IncludingSubfolders',true));
% Run the tests
results = runner.run(suites);
results.table
end