Skip to content

Commit

Permalink
Add CheckTestResults
Browse files Browse the repository at this point in the history
  • Loading branch information
eszmw committed Jun 24, 2024
1 parent 91b40b3 commit 711c9e3
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions SoftwareTests/CheckTestResults.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
classdef CheckTestResults < matlab.unittest.TestCase

properties (SetAccess = protected)
end

properties (ClassSetupParameter)
Project = {''};
end

properties (TestParameter)
Version
end


methods (TestParameterDefinition,Static)

function Version = GetResults(Project)
RootFolder = currentProject().RootFolder;
Version = dir(fullfile(RootFolder,"SoftwareTests","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("SoftwareTests","TestResults_"+Version+".txt");
Results = readtable(File,TextType="string");
testCase.verifyTrue(all(Results.Passed));
end

end

end

0 comments on commit 711c9e3

Please sign in to comment.