Skip to content

Commit eaa1c7e

Browse files
committed
test: subprocess: allow Fortran to be missing
1 parent bcad5a3 commit eaa1c7e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/TestSubprocess.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,17 @@ function test_env_run(tc)
107107

108108
methods (Test, TestTags=["exe", "java"])
109109

110-
function test_java_stdout_stderr(tc, lang_out)
110+
function test_Java_stdout_stderr(tc, lang_out)
111+
import matlab.unittest.constraints.IsFile
111112

112113
cwd = fileparts(mfilename('fullpath'));
113114
exe = cwd + "/stdout_stderr_" + lang_out + ".exe";
114-
tc.assertThat(exe, matlab.unittest.constraints.IsFile)
115+
116+
switch lang_out
117+
case "fortran", tc.assumeThat(exe, IsFile)
118+
case {"c", "cpp"}, tc.assertThat(exe, IsFile)
119+
otherwise, tc.assertTrue(false, "Unknown language: " + lang_out)
120+
end
115121

116122
[status, msg, err] = stdlib.java_run(exe);
117123
tc.assertEqual(status, 0, err)
@@ -121,10 +127,16 @@ function test_java_stdout_stderr(tc, lang_out)
121127

122128

123129
function test_java_stdin(tc, lang_in)
130+
import matlab.unittest.constraints.IsFile
124131

125132
cwd = fileparts(mfilename('fullpath'));
126133
exe = cwd + "/stdin_" + lang_in + ".exe";
127-
tc.assertThat(exe, matlab.unittest.constraints.IsFile)
134+
135+
switch lang_in
136+
case "fortran", tc.assumeThat(exe, IsFile)
137+
case {"c", "cpp"}, tc.assertThat(exe, IsFile)
138+
otherwise, tc.assertTrue(false, "Unknown language: " + lang_in)
139+
end
128140

129141
[status, msg, err] = stdlib.java_run(exe, stdin="1 2");
130142

0 commit comments

Comments
 (0)