-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunSystemTests.m
More file actions
98 lines (70 loc) · 2.33 KB
/
Copy pathRunSystemTests.m
File metadata and controls
98 lines (70 loc) · 2.33 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%% Runs ADC-Polyphase System Integration Tests
clear;
clc;
%% ==========================================
%% PROJECT ROOT
%% ==========================================
ProjectRoot = fileparts(mfilename("fullpath"));
% Ensure integration-owned helper/configuration files are visible even if
% this script is launched from another MATLAB working directory.
addpath(ProjectRoot);
%% ==========================================
%% SETUP PROJECT PATHS
%% ==========================================
SetupPaths();
%% ==========================================
%% RUN SYSTEM TESTS
%% ==========================================
TestRoot = fullfile(ProjectRoot, "Tests");
if ~isfolder(TestRoot)
error( ...
'ADCPolyphaseSystemIntegration:TestsNotFound', ...
'The system Tests folder could not be located.');
end
%% ==========================================
%% CREATE TEST SUITE
%% ==========================================
TestSuite = testsuite( ...
TestRoot, ...
"IncludeSubfolders", true);
%% ==========================================
%% CONFIGURE TEST RUNNER
%% ==========================================
Runner = matlab.unittest.TestRunner.withDefaultPlugins;
%% ==========================================
%% CI TEST REPORTING
%% ==========================================
if strcmpi(getenv("GITHUB_ACTIONS"), "true")
ReportRoot = fullfile( ...
ProjectRoot, ...
"test-results");
if ~isfolder(ReportRoot)
mkdir(ReportRoot);
end
%% JUnit XML report
import matlab.unittest.plugins.XMLPlugin
XMLReport = fullfile( ...
ReportRoot, ...
"system-test-results.xml");
Runner.addPlugin( ...
XMLPlugin.producingJUnitFormat(XMLReport));
%% HTML report
import matlab.unittest.plugins.TestReportPlugin
HTMLReport = fullfile( ...
ReportRoot, ...
"system-test-report.html");
Runner.addPlugin( ...
TestReportPlugin.producingHTML( ...
HTMLReport, ...
"Title", ...
"ADC-Polyphase System Verification Report"));
end
%% ==========================================
%% RUN TESTS
%% ==========================================
results = Runner.run(TestSuite);
disp(results);
%% ==========================================
%% VERIFY TEST RESULTS
%% ==========================================
assertSuccess(results);