|
1 | 1 | function plan = buildfile |
2 | 2 | import matlab.unittest.selectors.HasTag |
3 | | -import matlab.buildtool.tasks.TestTask |
4 | | -import matlabtest.plugins.codecoverage.StandaloneReport |
5 | | - |
6 | | -assert(~isMATLABReleaseOlderThan("R2022b"), "MATLAB R2022b or newer is required for this buildfile") |
7 | 3 |
|
8 | 4 | plan = buildplan(localfunctions); |
9 | 5 |
|
10 | 6 | if isMATLABReleaseOlderThan("R2023b") |
11 | | - plan("clean") =matlab.buildtool.Task(); |
| 7 | + plan("clean") = matlab.buildtool.Task(); |
12 | 8 | else |
13 | 9 | plan("clean") = matlab.buildtool.tasks.CleanTask; |
14 | 10 | end |
|
30 | 26 | if isMATLABReleaseOlderThan("R2023b") |
31 | 27 | plan("test_exe") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, HasTag("exe")), Dependencies="exe"); |
32 | 28 | elseif isMATLABReleaseOlderThan("R2024b") |
33 | | - plan("test_exe") = TestTask(test_root, Tag="exe", Dependencies="exe"); |
| 29 | + plan("test_exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Dependencies="exe"); |
34 | 30 | end |
35 | 31 |
|
36 | 32 | if isMATLABReleaseOlderThan("R2024b") |
|
42 | 38 | elseif isMATLABReleaseOlderThan("R2025a") |
43 | 39 | % Matlab == R2024b |
44 | 40 | plan("test:java") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cjava)); |
45 | | - plan("test:exe") = TestTask(test_root, Tag="exe", Dependencies="exe"); |
| 41 | + plan("test:exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Dependencies="exe"); |
46 | 42 | plan("test:nomex") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cnomex), Dependencies="clean"); |
47 | 43 | plan("test:mex") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cmex), Dependencies="mex"); |
48 | 44 |
|
49 | 45 | else |
50 | 46 | % Matlab >= R2025a |
51 | | - plan("test:exe") = TestTask(test_root, Tag="exe", Description="test subprocess",... |
| 47 | + plan("test:exe") = matlab.buildtool.tasks.TestTask(test_root, Tag="exe", Description="test subprocess",... |
52 | 48 | SourceFiles=[pkg_root, test_root + ["/*.cpp", "/*.c", "/*.f90"]], ... |
53 | 49 | RunOnlyImpactedTests=true,... |
54 | 50 | Dependencies="exe", TestResults="TestResults_exe.xml", Strict=true); |
55 | 51 |
|
56 | | - plan("test:nomex") = TestTask(test_root, Description="Test non-MEX targets",... |
| 52 | + plan("test:nomex") = matlab.buildtool.tasks.TestTask(test_root, Description="Test non-MEX targets",... |
57 | 53 | Selector=cnomex, ... |
58 | 54 | SourceFiles=pkg_root, RunOnlyImpactedTests=true,... |
59 | 55 | dependencies="clean_mex", TestResults="TestResults_nomex.xml", Strict=true); |
60 | 56 |
|
61 | | - plan("test:mex") = TestTask(test_root, Description="Test mex targts",... |
| 57 | + plan("test:mex") = matlab.buildtool.tasks.TestTask(test_root, Description="Test mex targts",... |
62 | 58 | Selector=cmex, ... |
63 | 59 | SourceFiles=[pkg_root, plan.RootFolder + "/src"], RunOnlyImpactedTests=true,... |
64 | 60 | Dependencies="mex", TestResults="TestResults_mex.xml", Strict=true); |
65 | 61 |
|
66 | | - plan("test:java") = TestTask(test_root, Description="test Java targets", ... |
| 62 | + plan("test:java") = matlab.buildtool.tasks.TestTask(test_root, Description="test Java targets", ... |
67 | 63 | Selector=cjava, ... |
68 | 64 | SourceFiles=pkg_root, RunOnlyImpactedTests=true,... |
69 | 65 | TestResults="TestResults_java.xml", Strict=true); |
70 | 66 |
|
71 | | - plan("test:python") = TestTask(test_root, Description="test Python targets", ... |
| 67 | + plan("test:python") = matlab.buildtool.tasks.TestTask(test_root, Description="test Python targets", ... |
72 | 68 | Tag="python", ... |
73 | 69 | SourceFiles=pkg_root, RunOnlyImpactedTests=true,... |
74 | 70 | TestResults="TestResults_python.xml", Strict=true); |
75 | 71 |
|
76 | | - plan("coverage") = TestTask(test_root, ... |
| 72 | + plan("coverage") = matlab.buildtool.tasks.TestTask(test_root, ... |
77 | 73 | Description="code coverage", ... |
78 | 74 | Dependencies=["clean_mex", "exe"], ... |
79 | 75 | SourceFiles=pkg_root, ... |
80 | 76 | Selector=cnomex | HasTag("java") | HasTag("exe") | HasTag("python"), ... |
81 | | - Strict=false).addCodeCoverage(StandaloneReport("coverage-report.html")); |
| 77 | + Strict=false).addCodeCoverage(matlabtest.plugins.codecoverage.StandaloneReport("coverage-report.html")); |
82 | 78 |
|
83 | 79 | plan("clean_mex") = matlab.buildtool.Task(Actions=@clean_mex, Description="Clean only MEX files to enable incremental tests"); |
84 | 80 | end |
|
0 commit comments