Skip to content

Commit 9904b41

Browse files
committed
Fixup deps and use TestItemRunner on 1.6
1 parent 29ab7f8 commit 9904b41

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

test/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
44
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
55
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
66
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7-
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
7+
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
88
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
99

1010
[compat]
1111
CUDA = "4, 5"
1212
Flux = "0.13.16, 0.14"
1313
Images = "0.26"
14-
Test = "1"
15-
TestItems = "0.1"
1614
ReTestItems = "1"
15+
Test = "1"
16+
TestItemRunner = "0.2"
1717
cuDNN = "1"

test/runtests.jl

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
using TestItems, ReTestItems
21
using Metalhead: Metalhead
32

43
# TODO account for GPU tests using name or tag filter
54
# TODO write GPU tests!
6-
test_group = get(ENV, "GROUP", "All")
7-
name_filter = test_group == "All" ? nothing : Regex(test_group)
8-
ReTestItems.runtests(Metalhead; name = name_filter)
5+
const test_group = get(ENV, "GROUP", "All")
6+
const name_filter = test_group == "All" ? nothing : Regex(test_group)
7+
8+
@static if VERSION >= v"1.7"
9+
using ReTestItems
10+
runtests(Metalhead; name = name_filter)
11+
else
12+
using TestItemRunner
13+
function testitem_filter(ti)
14+
return name_filter === nothing || match(name_filter, ti.name) !== nothing
15+
end
16+
end
17+
18+
# Not sure why this needs to be split into a separate conditional...
19+
@static if VERSION < v"1.7"
20+
@run_package_tests filter=testitem_filter
21+
end

0 commit comments

Comments
 (0)