|
11 | 11 | %% Self-test setup |
12 | 12 | plan("clean") = matlab.buildtool.tasks.CleanTask; |
13 | 13 |
|
| 14 | + |
14 | 15 | cnomex = ~HasTag("exe") & ~HasTag("mex"); |
15 | 16 | if isMATLABReleaseOlderThan("R2024b") |
16 | 17 | cnomex = cnomex & ~HasTag("symlink"); |
|
35 | 36 | plan("test:nojavamex") = matlab.buildtool.Task(Actions=@(context) legacy_test(context, cnojavamex), Dependencies="clean"); |
36 | 37 |
|
37 | 38 | else |
38 | | - % can't use SourceFiles= if "mex" Task was run, even if plan("test").DisableIncremental = true; |
39 | | - % this means incremental tests can't be used with MEX files (as of R2024b) |
40 | 39 | plan("test:exe") = matlab.buildtool.tasks.TestTask("test", Tag="exe", ... |
41 | 40 | Dependencies="exe", TestResults="TestResults_exe.xml", Strict=false); |
42 | 41 |
|
43 | 42 | plan("test:nomex") = matlab.buildtool.tasks.TestTask("test", ... |
44 | | - Selector=cnomex, ... |
45 | | - Dependencies="clean", TestResults="TestResults_nomex.xml", Strict=false); |
| 43 | + Selector=cnomex, SourceFiles="+stdlib/", RunOnlyImpactedTests=true,... |
| 44 | + dependencies="clean_mex", TestResults="TestResults_nomex.xml", Strict=false); |
46 | 45 |
|
47 | 46 | plan("test:mex") = matlab.buildtool.tasks.TestTask("test", ... |
48 | | - Selector=cmex, ... |
| 47 | + Selector=cmex, SourceFiles=["+stdlib/", "src/"], RunOnlyImpactedTests=true,... |
49 | 48 | Dependencies="mex", TestResults="TestResults_mex.xml", Strict=false); |
50 | 49 |
|
51 | 50 | plan("test:nojavamex") = matlab.buildtool.tasks.TestTask("test", ... |
52 | | - Selector=cnojavamex, ... |
53 | | - Dependencies="clean", TestResults="TestResults_nojavamex.xml", Strict=false); |
| 51 | + Selector=cnojavamex, SourceFiles="+stdlib/", RunOnlyImpactedTests=true,... |
| 52 | + Dependencies="clean_mex", TestResults="TestResults_nojavamex.xml", Strict=false); |
54 | 53 |
|
| 54 | + plan("clean_mex") = matlab.buildtool.Task(Actions=@clean_mex); |
55 | 55 | end |
56 | 56 |
|
57 | 57 | td = plan.RootFolder + "/test"; |
|
107 | 107 | end |
108 | 108 |
|
109 | 109 |
|
| 110 | +function clean_mex(context) |
| 111 | +run(context.Plan, "clean", {"mex"}); |
| 112 | +end |
| 113 | + |
| 114 | + |
110 | 115 | function legacy_mex(context, compiler_opt, linker_opt) |
111 | 116 | bindir = fileparts(context.Task.Outputs.Path); |
112 | 117 | mex(context.Task.Inputs.Path, "-outdir", bindir, compiler_opt{:}, linker_opt) |
|
0 commit comments