Skip to content

Commit ef9af2a

Browse files
committed
buildtool test task for R2022b+
1 parent 8d4018c commit ef9af2a

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/composite-nomex/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
uses: matlab-actions/run-build@v2
3636
with:
3737
startup-options: ${{ matrix.startup-options }}
38-
tasks: test_java
38+
tasks: test_java test_java_exe
3939

4040

4141
- name: Exe Test (>= R2024b)

buildfile.m

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,46 @@
33

44
plan = buildplan(localfunctions);
55

6-
cnomex = ~HasTag("exe") & ~HasTag("mex") & ~HasTag("java") & ~HasTag("java_exe") & ~HasTag("python");
6+
sel = ~HasTag("exe") & ~HasTag("java") & ~HasTag("java_exe") & ~HasTag("python");
77
if ispc()
8-
cnomex = cnomex & ~HasTag("unix");
8+
sel = sel & ~HasTag("unix");
99
else
10-
cnomex = cnomex & ~HasTag("windows");
10+
sel = sel & ~HasTag("windows");
1111
end
1212

1313
reportDir = fullfile(plan.RootFolder, ".buildtool");
1414
pkg_root = fullfile(plan.RootFolder, "+stdlib");
1515
test_root = fullfile(plan.RootFolder, "test");
1616

1717
if ~isMATLABReleaseOlderThan("R2023b")
18-
plan("clean") = matlab.buildtool.tasks.CleanTask;
18+
plan("clean") = matlab.buildtool.tasks.CleanTask();
1919
end
2020

2121
if isMATLABReleaseOlderThan("R2024b")
2222

23-
plan("test_main") = matlab.buildtool.Task(Actions=@(context) test_main(context, cnomex));
23+
plan("test_main") = matlab.buildtool.Task(Actions=@(context) test_main(context, sel));
24+
plan("test_java") = matlab.buildtool.tasks.TestTask(test_root, Tag="java");
25+
26+
plan("test") = matlab.buildtool.Task(Dependencies=["test_main", "test_java"]);
2427

2528
if isMATLABReleaseOlderThan('R2023b')
2629
return
2730
end
2831

29-
plan("test_java") = matlab.buildtool.tasks.TestTask(test_root, Tag="java");
32+
plan("test_java_exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="java_exe", Dependencies="exe");
3033
plan("test_exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Dependencies="exe");
3134

35+
plan("test").Dependencies = [plan("test").Dependencies, "test_java_exe", "test_exe"];
36+
3237
elseif isMATLABReleaseOlderThan("R2025a")
3338
% Matlab == R2024b
34-
plan("test:main") = matlab.buildtool.Task(Actions=@(context) test_main(context, cnomex));
39+
plan("test:main") = matlab.buildtool.Task(Actions=@(context) test_main(context, sel));
3540

3641
else
3742
% Matlab >= R2025a
3843
plan("test:main") = matlab.buildtool.tasks.TestTask(...
3944
test_root, Description="Test non-MEX targets", ...
40-
Selector=cnomex, ...
45+
Selector=sel, ...
4146
SourceFiles=pkg_root, ...
4247
RunOnlyImpactedTests=stdlib.checkout_license("MATLAB Test"), ...
4348
TestResults=reportDir + "/TestResults_nomex.xml", Strict=true);

test_main.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function test_main(context, sel)
22
arguments
33
context = []
4-
sel = ~HasTag("exe") & ~HasTag("mex") & ~HasTag("java_exe")
4+
sel = ~HasTag("exe") & ~HasTag("java_exe")
55
end
66

77
import matlab.unittest.TestRunner

0 commit comments

Comments
 (0)