Skip to content

Commit cd432d0

Browse files
committed
Updated solutions and testing.
1 parent 1827560 commit cd432d0

File tree

10 files changed

+62
-62
lines changed

10 files changed

+62
-62
lines changed
Binary file not shown.
Binary file not shown.
35.4 KB
Binary file not shown.
34.2 KB
Binary file not shown.
38.1 KB
Binary file not shown.
35.2 KB
Binary file not shown.
Binary file not shown.

SoftwareTests/SolnSmokeTests.m

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -68,66 +68,66 @@ function SetUpPath(testCase,Project)
6868

6969
end % methods (TestClassSetup)
7070

71-
% methods(Test)
72-
%
73-
% % Check that solutions files exist for each of the student
74-
% % templates
75-
% function ExistSolns(testCase,File)
76-
% SolutionName = replace(string(File),".mlx","Soln.mlx");
77-
% assert(exist(SolutionName,"file"),"Missing solutions for "+File);
78-
% end
79-
%
80-
%
81-
% function SmokeRun(testCase,File)
82-
%
83-
% % Navigate to project root folder:
84-
% cd(testCase.RootFolder)
85-
% FileToRun = replace(string(File),".mlx","Soln.mlx");
86-
%
87-
% % Pre-test:
88-
% PreFiles = CheckPreFile(testCase,FileToRun);
89-
% run(PreFiles);
90-
%
91-
% % Run SmokeTest
92-
% disp(">> Running " + FileToRun);
93-
% try
94-
% run(fullfile("InstructorResources","Solutions",FileToRun));
95-
% catch ME
96-
%
97-
% end
98-
%
99-
% % Post-test:
100-
% PostFiles = CheckPostFile(testCase,FileToRun);
101-
% run(PostFiles)
102-
%
103-
% % Log every figure created during run:
104-
% Figures = findall(groot,'Type','figure');
105-
% Figures = flipud(Figures);
106-
% if ~isempty(Figures)
107-
% for f = 1:size(Figures,1)
108-
% if ~isempty(Figures(f).Number)
109-
% FigDiag = matlab.unittest.diagnostics.FigureDiagnostic(Figures(f),'Formats','png');
110-
% log(testCase,1,FigDiag);
111-
% end
112-
% end
113-
% end
114-
%
115-
% % Close all figures and Simulink models
116-
% close all force
117-
% if any(matlab.addons.installedAddons().Name == "Simulink")
118-
% bdclose all
119-
% end
120-
%
121-
% % Rethrow error if any
122-
% if exist("ME","var")
123-
% if ~any(strcmp(ME.identifier,KnownIssuesID))
124-
% rethrow(ME)
125-
% end
126-
% end
127-
%
128-
% end
129-
%
130-
% end % Test Methods
71+
methods(Test)
72+
73+
% Check that solutions files exist for each of the student
74+
% templates
75+
function ExistSolns(testCase,File)
76+
SolutionName = replace(string(File),".mlx","Soln.mlx");
77+
assert(exist(SolutionName,"file"),"Missing solutions for "+File);
78+
end
79+
80+
81+
function SmokeRun(testCase,File)
82+
83+
% Navigate to project root folder:
84+
cd(testCase.RootFolder)
85+
FileToRun = replace(string(File),".mlx","Soln.mlx");
86+
87+
% Pre-test:
88+
PreFiles = CheckPreFile(testCase,FileToRun);
89+
run(PreFiles);
90+
91+
% Run SmokeTest
92+
disp(">> Running " + FileToRun);
93+
try
94+
run(fullfile("InstructorResources","Solutions",FileToRun));
95+
catch ME
96+
97+
end
98+
99+
% Post-test:
100+
PostFiles = CheckPostFile(testCase,FileToRun);
101+
run(PostFiles)
102+
103+
% Log every figure created during run:
104+
Figures = findall(groot,'Type','figure');
105+
Figures = flipud(Figures);
106+
if ~isempty(Figures)
107+
for f = 1:size(Figures,1)
108+
if ~isempty(Figures(f).Number)
109+
FigDiag = matlab.unittest.diagnostics.FigureDiagnostic(Figures(f),'Formats','png');
110+
log(testCase,1,FigDiag);
111+
end
112+
end
113+
end
114+
115+
% Close all figures and Simulink models
116+
close all force
117+
if any(matlab.addons.installedAddons().Name == "Simulink")
118+
bdclose all
119+
end
120+
121+
% Rethrow error if any
122+
if exist("ME","var")
123+
if ~any(strcmp(ME.identifier,KnownIssuesID))
124+
rethrow(ME)
125+
end
126+
end
127+
128+
end
129+
130+
end % Test Methods
131131

132132
methods (Access = private)
133133

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<?xml version='1.0' encoding='UTF-8'?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<Info/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<?xml version='1.0' encoding='UTF-8'?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<Info location="README.md" type="File"/>

0 commit comments

Comments
 (0)