Skip to content

Commit 04ac0ec

Browse files
committed
feat(matlab): support multiple test files
1 parent 0670c7b commit 04ac0ec

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

buildfile.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if isMATLABReleaseOlderThan("R2023b")
1212
plan("test") = matlab.buildtool.Task( ...
1313
Description="Run tests", ...
14-
Actions=@(~) assert(runtests().Failed == 0));
14+
Actions=@(~) assert(run_tests()) );
1515

1616
plan("check") = matlab.buildtool.Task(...
1717
Description="Identify code issues", ...
@@ -32,3 +32,11 @@
3232
warnings = find(issues.Severity == 'warning');
3333
flag = (numel(errors) == 0) && (numel(warnings) <= warning_threshold);
3434
end
35+
36+
function flag = run_tests()
37+
flag = true;
38+
test_results = runtests("IncludeSubfolders",true);
39+
for test_result=test_results
40+
flag = flag & (test_result.Failed == 0);
41+
end
42+
end

0 commit comments

Comments
 (0)