@@ -151,7 +151,7 @@ function runtest(::Type{TestRecord}, f, name)
151151 Random. seed! (1 )
152152
153153 res = @timed @testset $ name begin
154- Main . include ( $ f )
154+ $ f ( )
155155 end
156156 (res... ,)
157157 end
@@ -200,7 +200,8 @@ function runtest(::Type{TestRecord}, f, name)
200200 return res
201201end
202202
203- function runtests (ARGS , testfilter = _ -> true , RecordType = TestRecord)
203+ function runtests (ARGS ; testfilter = _ -> true , RecordType = TestRecord,
204+ custom_tests:: Dict{String} = Dict {String} ())
204205 do_help, _ = extract_flag! (ARGS , " --help" )
205206 if do_help
206207 println (
@@ -232,6 +233,11 @@ function runtests(ARGS, testfilter = _ -> true, RecordType = TestRecord)
232233 # choose tests
233234 tests = []
234235 test_runners = Dict ()
236+ # # custom tests by the user
237+ for (name, runner) in custom_tests
238+ push! (tests, name)
239+ test_runners[name] = runner
240+ end
235241 # # files in the test folder
236242 for (rootpath, dirs, files) in walkdir (WORKDIR)
237243 # find Julia files
@@ -260,10 +266,10 @@ function runtests(ARGS, testfilter = _ -> true, RecordType = TestRecord)
260266
261267 append! (tests, files)
262268 for file in files
263- test_runners[file] = joinpath (" $ WORKDIR" , " $file .jl" )
269+ test_runners[file] = () -> Main . include ( joinpath (WORKDIR, " $file .jl" ) )
264270 end
265271 end
266- sort! (tests; by = (file) -> stat (joinpath (" $ WORKDIR" , " $file .jl" )). size, rev = true )
272+ sort! (tests; by = (file) -> stat (joinpath (WORKDIR, " $file .jl" )). size, rev = true )
267273 # # finalize
268274 unique! (tests)
269275
0 commit comments