From 98be1aeb935c52afacc4b90c8a2aada349483cde Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Fri, 31 Mar 2023 10:36:45 -0700 Subject: [PATCH] Fix error reporting --- src/TestItemRunner2.jl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/TestItemRunner2.jl b/src/TestItemRunner2.jl index 15d7add..a7ea5fb 100644 --- a/src/TestItemRunner2.jl +++ b/src/TestItemRunner2.jl @@ -223,7 +223,20 @@ end function run_tests(path; filter=nothing, verbose=false, max_workers::Int=Sys.CPU_THREADS, timeout=60*5, return_results=false, print_failed_results=true) jw = JuliaWorkspace(Set([filepath2uri(path)])) - count(Iterators.flatten(values(jw._testerrors))) > 0 && error("There is an error in your test item or test setup definition, we are aborting.") + if count(i -> true, Iterators.flatten(values(jw._testerrors))) > 0 + println("There are errors in your test definitions, we are aborting.") + + for te in Iterators.flatten(values(jw._testerrors)) + pos = JuliaWorkspaces.get_position_from_offset(jw._text_documents[te.uri], te.range[1]) + println() + println("File: $(uri2filepath(te.uri)):$(pos[1]+1)") + println() + println(te.message) + println() + end + + return nothing + end # testsetups maps @testsetup PACKAGE => NAME => TESTSETUPdetail testsetups = Dict{JuliaWorkspaces.URIs2.URI,Dict{Symbol,Any}}()