Skip to content

Commit 711c9e3

Browse files
committed
Add CheckTestResults
1 parent 91b40b3 commit 711c9e3

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

SoftwareTests/CheckTestResults.m

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
classdef CheckTestResults < matlab.unittest.TestCase
2+
3+
properties (SetAccess = protected)
4+
end
5+
6+
properties (ClassSetupParameter)
7+
Project = {''};
8+
end
9+
10+
properties (TestParameter)
11+
Version
12+
end
13+
14+
15+
methods (TestParameterDefinition,Static)
16+
17+
function Version = GetResults(Project)
18+
RootFolder = currentProject().RootFolder;
19+
Version = dir(fullfile(RootFolder,"SoftwareTests","TestResults*.txt"));
20+
Version = extractBetween([Version.name],"TestResults_",".txt");
21+
end
22+
23+
end
24+
25+
methods (TestClassSetup)
26+
27+
function SetUpSmokeTest(testCase,Project)
28+
try
29+
currentProject;
30+
catch
31+
error("Project is not loaded.")
32+
end
33+
end
34+
35+
end
36+
37+
methods(Test)
38+
39+
function CheckResults(testCase,Version)
40+
File = fullfile("SoftwareTests","TestResults_"+Version+".txt");
41+
Results = readtable(File,TextType="string");
42+
testCase.verifyTrue(all(Results.Passed));
43+
end
44+
45+
end
46+
47+
end

0 commit comments

Comments
 (0)