From f660414bfc4b926e9e763b083fb12a45a67de1c9 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 10 Oct 2025 18:28:26 +0200 Subject: [PATCH] Test failure and throwing --- test/runtests.jl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f1a7fb5..8e6bbd1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,5 @@ using ParallelTestRunner +using Test pushfirst!(ARGS, "--verbose") @@ -24,7 +25,7 @@ runtests(ARGS; init_code, custom_tests) # custom worker function test_worker(name) if name == "needs env var" - return addworker(env=["SPECIAL_ENV_VAR"=>"42"]) + return addworker(env = ["SPECIAL_ENV_VAR" => "42"]) end return nothing end @@ -37,3 +38,19 @@ custom_tests = Dict( end ) runtests(ARGS; test_worker, custom_tests) + +# failing test +custom_tests = Dict( + "failing test" => quote + @test 1 == 2 + end +) +@test_throws Test.FallbackTestSetException("Test run finished with errors") runtests(ARGS; custom_tests) + +# throwing test +custom_tests = Dict( + "throwing test" => quote + error("This test throws an error") + end +) +@test_throws Test.FallbackTestSetException("Test run finished with errors") runtests(ARGS; custom_tests)