Skip to content

Commit 5a1bbb5

Browse files
committed
ci: some systems block Cwd changes (windows-2025 GA)
1 parent 1ddc8b4 commit 5a1bbb5

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

test/TestDisk.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
TestDisk < matlab.unittest.TestCase
33

44
properties
5-
CI = getenv("CI") == "true" || getenv("GITHUB_ACTIONS") == "true"
5+
CI = is_ci()
66
end
77

88
properties (TestParameter)

test/TestSubprocess.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
classdef (TestTags = {'R2019b'}) ...
22
TestSubprocess < matlab.unittest.TestCase
33

4+
properties
5+
CI = is_ci()
6+
end
7+
48
properties (TestParameter)
59
lang_out = {"c", "fortran"}
610
lang_in = {"cpp", "fortran"}
@@ -35,6 +39,9 @@ function test_cwd(tc)
3539

3640
[s, mc] = stdlib.subprocess_run(c, 'cwd', matlabroot, 'echo', cmd_echo);
3741
tc.assertEqual(s, 0, "status non-zero")
42+
43+
tc.assumeFalse(~strcmp(m, mc) && tc.CI, "Some CI block cwd changes")
44+
3845
tc.verifyNotEqual(m, mc, "expected different directory to have different contents")
3946

4047
end

test/private/is_ci.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function ok = is_ci()
2+
3+
ok = getenv("CI") == "true" || getenv("GITHUB_ACTIONS") == "true";
4+
5+
end

test_main.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ function test_main(context, sel)
2525
% selectIf takes the subset of suite tests that meet "sel" conditions
2626
suite = suite.selectIf(sel);
2727

28+
pms = [suite.Parameterization];
29+
pv = pms.Value;
30+
31+
need_dotnet = pv == "dotnet";
32+
2833
runner = TestRunner.withTextOutput;
2934
r = runner.run(suite);
3035

0 commit comments

Comments
 (0)