-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCheckTestResults.m
49 lines (35 loc) · 1.09 KB
/
CheckTestResults.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
46
47
48
49
classdef CheckTestResults < matlab.unittest.TestCase
properties (SetAccess = protected)
end
properties (ClassSetupParameter)
Project = {currentProject()};
end
properties (TestParameter)
Version
end
methods (TestParameterDefinition,Static)
function Version = GetResults(Project)
RootFolder = Project.RootFolder;
Version = dir(fullfile(RootFolder,"public","TestResults*.txt"));
Version = extractBetween([Version.name],"TestResults_",".txt");
end
end
methods (TestClassSetup)
function SetUpSmokeTest(testCase,Project)
try
currentProject;
catch
error("Project is not loaded.")
end
end
end
methods(Test)
function CheckResults(testCase,Version)
File = fullfile("public","TestResults_"+Version+".txt");
Results = readtable(File,TextType="string");
if ~all(Results.Passed)
error("Some of the tests did not pass.")
end
end
end
end