Skip to content

Commit fd93a91

Browse files
committed
test: filter non-jvm tests
1 parent aad9830 commit fd93a91

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/TestFileImpure.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ function test_null_file(tc)
8080

8181

8282
function test_is_regular_file(tc)
83-
import matlab.unittest.constraints.IsFile
83+
import matlab.unittest.constraints.IsFile
84+
tc.assumeTrue(stdlib.has_java)
8485
if ~ispc
8586
tc.assumeThat(stdlib.null_file, IsFile)
8687
end
@@ -90,7 +91,7 @@ function test_is_regular_file(tc)
9091

9192

9293
function test_touch_modtime(tc)
93-
94+
tc.assumeTrue(stdlib.has_java)
9495
fn = tempname;
9596
tc.verifyTrue(stdlib.touch(fn))
9697
t0 = stdlib.get_modtime(fn);
@@ -114,13 +115,14 @@ function test_makedir(tc)
114115

115116
%%
116117
function test_samepath(tc, in_same, other_same, ref_same)
118+
tc.assumeTrue(stdlib.has_java)
117119
tc.verifyEqual(stdlib.samepath(in_same, other_same), ref_same)
118120
end
119121

120122
function test_hash(tc)
121123
import matlab.unittest.constraints.IsFile
122124
import matlab.unittest.fixtures.TemporaryFolderFixture
123-
125+
tc.assumeTrue(stdlib.has_java)
124126
fixture = tc.applyFixture(TemporaryFolderFixture);
125127

126128
fn = stdlib.join(fixture.Folder, "hello");
@@ -149,7 +151,7 @@ function test_filesystem_type(tc)
149151

150152

151153
function test_owner(tc)
152-
154+
tc.assumeTrue(stdlib.has_java)
153155
owner = stdlib.get_owner('.');
154156
L = strlength(owner);
155157
tc.verifyGreaterThan(L, 0, "expected non-empty username")
@@ -158,14 +160,15 @@ function test_owner(tc)
158160

159161

160162
function test_username(tc)
161-
163+
tc.assumeTrue(stdlib.has_java)
162164
u = stdlib.get_username();
163165
L = strlength(u);
164166
tc.verifyGreaterThan(L, 0, "expected non-empty username")
165167

166168
end
167169

168170
function test_hostname(tc)
171+
tc.assumeTrue(stdlib.has_java)
169172
h = stdlib.hostname();
170173
L = strlength(h);
171174
tc.verifyGreaterThan(L, 0, "expected non-empty hostname")
@@ -191,18 +194,20 @@ function test_handle2filename(tc)
191194
end
192195

193196
function test_java_version(tc)
197+
tc.assumeTrue(stdlib.has_java)
194198
v = stdlib.java_version();
195199
L = strlength(v);
196200
tc.verifyGreaterThanOrEqual(L, 4)
197201
end
198202

199203
function test_java_api(tc)
204+
tc.assumeTrue(stdlib.has_java)
200205
v = stdlib.java_api();
201206
tc.verifyGreaterThanOrEqual(v, 8)
202207
end
203208

204209
function test_hard_link_count(tc)
205-
210+
tc.assumeTrue(stdlib.has_java)
206211
fn = mfilename("fullpath") + ".m";
207212

208213
if ispc

0 commit comments

Comments
 (0)