Skip to content

Commit ec43ff2

Browse files
committed
Fix
1 parent 2e821a8 commit ec43ff2

2 files changed

Lines changed: 8 additions & 21 deletions

File tree

src/ParallelTestRunner.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ function runtest(::Type{TestRecord}, f, name, init_code, color)
222222
mod = @eval(Main, module $(gensym(name)) end)
223223
@eval(mod, import ParallelTestRunner: Test, Random, RemoteTestSets)
224224
@eval(mod, using .Test, .Random, .RemoteTestSets)
225+
@eval(mod, using .Test: DefaultTestSet) # Necessary because VERSION <= v"1.10.0-" does not support unexported TestSets the @testset
225226

226227
Core.eval(mod, init_code)
227228

src/remotetestset.jl

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module RemoteTestSets
33
export RemoteTestSet, @remote_testset
44

55
import Test
6-
import Test: AbstractTestSet, DefaultTestSet, Broken, Pass, Fail, Error
6+
import Test: AbstractTestSet, DefaultTestSet, Broken, Pass, Fail, Error, @testset
77

88
struct RemoteTestSet <: AbstractTestSet
99
ts::DefaultTestSet
@@ -73,27 +73,13 @@ macro remote_testset(args...)
7373
end
7474

7575
source = args[end]
76-
if isnothing(testsettype)
77-
testsettype = :(Test.DefaultTestSet)
78-
end
76+
testsettype = isnothing(testsettype) ? :(DefaultTestSet) : testsettype
7977

80-
# Build the inner @testset call
81-
inner_testset = Expr(:macrocall,
82-
:(Test.var"@testset"),
83-
LineNumberNode(@__LINE__, @__FILE__),
84-
testsettype,
85-
otherargs...,
86-
source)
87-
88-
# Build the outer @testset call with RemoteTestSet
89-
outer_testset = Expr(:macrocall,
90-
:(Test.var"@testset"),
91-
LineNumberNode(@__LINE__, @__FILE__),
92-
:RemoteTestSet,
93-
"wrapper",
94-
Expr(:block, inner_testset))
95-
96-
return esc(outer_testset)
78+
return esc(quote
79+
@testset RemoteTestSet "wrapper" begin
80+
@testset $testsettype $(otherargs...) $source
81+
end
82+
end)
9783
end
9884

9985
end

0 commit comments

Comments
 (0)