Skip to content

Commit a118e5d

Browse files
lkdvoskshyatt
authored andcommitted
add testsuite macro
1 parent 48c1ef6 commit a118e5d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testsuite/TestSuite.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,18 @@ Suite of tests that may be used for all packages inheriting from MatrixAlgebraKi
88
"""
99
module TestSuite
1010

11+
const tests = Dict()
12+
13+
macro testsuite(name, ex)
14+
safe_name = lowercase(replace(replace(name, " " => "_"), "/" => "_"))
15+
fn = Symbol("test_", safe_name)
16+
return quote
17+
$(esc(fn))(AT; eltypes = supported_eltypes(AT, $(esc(fn)))) = $(esc(ex))(AT, eltypes)
18+
@assert !haskey(tests, $name) "testsuite already exists"
19+
tests[$name] = $fn
20+
end
21+
end
22+
23+
end
24+
1125
end

0 commit comments

Comments
 (0)