From 5891ea97cdda63931f7d911d9c779d00eaf4f3bf Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Fri, 10 Feb 2023 19:39:10 -0800 Subject: [PATCH] Squashed 'packages/TestItemServer/' changes from 2303253b..a31cd339 a31cd339 Import testsetups 082e99b9 Remove a diagnostic git-subtree-dir: packages/TestItemServer git-subtree-split: a31cd3394c98ed657324aaf1e4648791bfcd67da --- src/TestItemServer.jl | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/TestItemServer.jl b/src/TestItemServer.jl index 05b4545..b434878 100644 --- a/src/TestItemServer.jl +++ b/src/TestItemServer.jl @@ -144,8 +144,6 @@ function run_testitem_handler(conn, params::TestserverRunTestitemRequestParams) end end - @info "AND WE GOT PAST THIS" - mod = Core.eval(Main, :(module $(gensym()) end)) if params.useDefaultUsings @@ -191,6 +189,26 @@ function run_testitem_handler(conn, params::TestserverRunTestitemRequestParams) end end + for i in params.testsetups + try + Core.eval(mod, :(using ..Testsetups: $(Symbol(i)))) + catch + return TestserverRunTestitemRequestParamsReturn( + "errored", + [ + TestMessage( + "Unable to load the `$i` testsetup.", + Location( + params.uri, + Range(Position(params.line, 0), Position(params.line, 0)) + ) + ) + ], + nothing + ) + end + end + filepath = uri2filepath(params.uri) code = string('\n'^params.line, ' '^params.column, params.code)