Skip to content

Commit 3b83b29

Browse files
committed
Update SmokeTest for additional robustness
1 parent 48fff3d commit 3b83b29

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

SoftwareTests/SmokeTests.m

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
% Run these tests with runMyTests
22
% All tests so far are on code expected to run without errors
3-
% If/when we end up with a version that _should_ error,
3+
% If/when we end up with a version that _should_ error,
44
% please add it to this set of examples
55
classdef SmokeTests < matlab.unittest.TestCase
6-
6+
77
properties
88
rootProject
99
results
1010
end
1111

1212

13-
methods (TestClassSetup)
13+
methods (TestClassSetup)
1414

1515
function setUpPath(testCase)
16-
16+
1717
try
1818
project = currentProject;
1919
testCase.rootProject = project.RootFolder;
2020
cd(testCase.rootProject)
2121
catch
2222
error("Load project prior to run tests")
2323
end
24-
24+
2525
testCase.log("Running in " + version)
2626

2727
end % function setUpPath
@@ -58,15 +58,10 @@ function smokeTest(testCase)
5858
fprintf(fid,"%s,%s,%s,%s\n",release_version,myFiles(kTest),"passed",testCase.results.Time(kTest));
5959
catch ME
6060
testCase.results.Time(kTest) = toc;
61-
if ME.message == "Unknown service"
62-
disp("Expected error: no doc availabile.")
63-
testCase.results.Passed(kTest) = true;
64-
else
65-
disp("Failed " + myFiles(kTest) + " because " + ...
61+
disp("Failed " + myFiles(kTest) + " because " + ...
6662
newline + ME.message)
67-
testCase.results.Message(kTest) = ME.message;
68-
fprintf(fid,"%s,%s,%s,%s\n",release_version,myFiles(kTest),"failed",testCase.results.Time(kTest));
69-
end
63+
testCase.results.Message(kTest) = ME.message;
64+
fprintf(fid,"%s,%s,%s,%s\n",release_version,myFiles(kTest),"failed",testCase.results.Time(kTest));
7065
end
7166
clearvars -except kTest testCase myFiles fid
7267
end
@@ -85,4 +80,8 @@ function closeAllFigure(testCase)
8580

8681
end % methods (TestClassTeardown)
8782

83+
end
84+
85+
function doc(arg)
86+
disp("doc " + string(arg))
8887
end

0 commit comments

Comments
 (0)