@@ -3,7 +3,7 @@ module RemoteTestSets
33export RemoteTestSet, @remote_testset
44
55import Test
6- import Test: AbstractTestSet, DefaultTestSet, Broken, Pass, Fail, Error
6+ import Test: AbstractTestSet, DefaultTestSet, Broken, Pass, Fail, Error, @testset
77
88struct 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 )
9783end
9884
9985end
0 commit comments