Skip to content

Commit 53c06fb

Browse files
committed
tag tests
1 parent 510ab91 commit 53c06fb

25 files changed

+72
-55
lines changed

buildfile.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
Selector=cjava, ...
6161
TestResults="TestResults_java.xml", Strict=true);
6262

63-
plan("test:hdf4") = matlab.buildtool.tasks.TestTask("test", Tag="hdf4", Strict=true);
64-
plan("test:hdf5") = matlab.buildtool.tasks.TestTask("test", Tag="hdf5", Strict=true);
65-
6663
plan("clean_mex") = matlab.buildtool.Task(Actions=@clean_mex, Description="Clean only MEX files to enable incremental tests");
6764
end
6865

test/TestAbsolute.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function set_cwd(tc)
1919
end
2020

2121

22-
methods(Test)
22+
methods(Test, TestTags="pure")
2323

2424
function test_absolute1arg(tc, p1)
2525

test/TestCanonical.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414

1515

16-
methods(Test)
16+
methods(Test, TestTags="impure")
1717

1818
function test_canonical(tc, p)
1919
tc.verifyEqual(stdlib.canonical(p{1}), p{2})

test/TestDisk.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Ps = {".", "", "not-exist"}
55
end
66

7-
methods(Test, TestTags = "mex")
7+
methods(Test, TestTags = ["mex"])
88

99
function test_mex_disk_available(tc)
1010
tc.assertTrue(stdlib.is_mex_fun("stdlib.disk_available"))
@@ -16,7 +16,7 @@ function test_mex_disk_capacity(tc)
1616

1717
end
1818

19-
methods (Test, TestTags = "java")
19+
methods (Test, TestTags = ["java"])
2020

2121
function test_disk_available(tc, Ps)
2222

test/TestExists.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
% on CI matlabroot can be writable!
88
end
99

10-
methods (Test)
10+
methods (Test, TestTags="impure")
1111

1212
function test_exists(tc, Ps)
1313
ok = stdlib.exists(Ps{1});

test/TestExpanduser.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
{"~//c", stdlib.homedir() + "//c"}};
1313
end
1414

15-
methods(Test)
15+
methods(Test, TestTags="impure")
1616

1717
function test_expanduser(tc, p)
1818
tc.verifyEqual(stdlib.expanduser(p{1}), p{2})
1919
end
2020

2121
end
2222

23-
end
23+
end

test/TestFileImpure.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414

1515

16-
methods (Test)
16+
methods (Test, TestTags="impure")
1717

1818
function test_file_size(tc, p_file_size)
1919
s = stdlib.file_size(p_file_size);

test/TestFilePure.m

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
classdef TestFilePure < matlab.unittest.TestCase
22

33
properties (TestParameter)
4-
p = init_root_name()
4+
p = {{"", ""}, {"a/b", ""}, {'/etc', ''}}
5+
pu = {{"c:/etc", ""}}
6+
pw = {{"c:/etc", "c:"}}
57
end
68

79

8-
methods (Test)
10+
methods (Test, TestTags="pure")
911

1012
function test_posix(tc)
1113

@@ -15,27 +17,26 @@ function test_posix(tc)
1517
if ispc
1618
tc.verifyEqual(stdlib.posix("c:\abc"), "c:/abc")
1719
end
18-
end
1920

21+
end
2022

2123
function test_root_name(tc, p)
2224
tc.verifyEqual(stdlib.root_name(p{1}), p{2})
2325
end
26+
end
2427

28+
methods(Test, TestTags=["pure", "unix"])
29+
function test_root_name_unix(tc, pu)
30+
tc.assumeTrue(isunix)
31+
tc.verifyEqual(stdlib.root_name(pu{1}), pu{2})
2532
end
2633
end
2734

28-
29-
function p = init_root_name()
30-
31-
p = {{"", ""}, ...
32-
{"a/b", ""}, ...
33-
{'/etc', ''}, ...
34-
{"c:/etc", ""}
35-
};
36-
37-
if ispc
38-
p{4}{2} = "c:";
35+
methods(Test, TestTags=["pure", "windows"])
36+
function test_root_name_windows(tc, pw)
37+
tc.assumeTrue(ispc, "This test is only for Windows")
38+
tc.verifyEqual(stdlib.root_name(pw{1}), pw{2})
39+
end
3940
end
4041

4142
end

test/TestFilename.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
};
1212
end
1313

14-
methods (Test)
14+
methods (Test, TestTags="pure")
1515
function test_filename(tc, p)
1616
tc.verifyEqual(stdlib.filename(p{1}), p{2})
1717
end

test/TestIsAbsolute.m

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
11
classdef TestIsAbsolute < matlab.unittest.TestCase
22

33
properties (TestParameter)
4-
p = init_is_absolute()
4+
p = {{"", false}, {"x", false}, {"x:", false}}
5+
pu = {{"x:/foo", false}, {"/foo", true}}
6+
pw = {{"x:/foo", true}, {"/foo", false}}
7+
58
end
69

7-
methods (Test)
10+
methods (Test, TestTags="pure")
11+
812
function test_is_absolute(tc, p)
913
ok = stdlib.is_absolute(p{1});
1014
tc.verifyEqual(ok, p{2}, p{1})
1115
end
16+
17+
end
18+
19+
20+
methods (Test, TestTags=["pure", "unix"])
21+
22+
function test_is_absolute_unix(tc, pu)
23+
tc.assumeTrue(isunix())
24+
ok = stdlib.is_absolute(pu{1});
25+
tc.verifyEqual(ok, pu{2}, pu{1})
1226
end
27+
1328
end
1429

1530

16-
function p = init_is_absolute()
17-
p = {{"", false}, {"x", false}, {"x:", false}, {"x:/foo", false}, {"/foo", true}};
18-
if ispc
19-
p{4}{2} = true;
20-
p{5}{2} = false;
31+
methods (Test, TestTags=["pure", "windows"])
32+
33+
function test_is_absolute_windows(tc, pw)
34+
tc.assumeTrue(ispc())
35+
ok = stdlib.is_absolute(pw{1});
36+
tc.verifyEqual(ok, pw{2}, pw{1})
2137
end
38+
2239
end
40+
41+
end
42+
43+

0 commit comments

Comments
 (0)