diff --git a/src/rtutils.c b/src/rtutils.c index b4432d8af3d0c..58b1f03445534 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -1316,6 +1316,11 @@ JL_DLLEXPORT void jl_breakpoint(jl_value_t *v) // put a breakpoint in your debugger here } +JL_DLLEXPORT void jl_test_failure_breakpoint(jl_value_t *v) +{ + // put a breakpoint in your debugger here +} + // logging tools -------------------------------------------------------------- void jl_log(int level, jl_value_t *module, jl_value_t *group, jl_value_t *id, diff --git a/stdlib/Test/src/Test.jl b/stdlib/Test/src/Test.jl index 95cd1ecccd9c3..302107eb3ded6 100644 --- a/stdlib/Test/src/Test.jl +++ b/stdlib/Test/src/Test.jl @@ -652,7 +652,7 @@ function do_test(result::ExecutionResult, orig_expr) @assert isa(result, Threw) testres = Error(:test_error, orig_expr, result.exception, result.backtrace::Vector{Any}, result.source) end - isa(testres, Pass) || ccall(:jl_breakpoint, Cvoid, (Any,), result) + isa(testres, Pass) || ccall(:jl_test_failure_breakpoint, Cvoid, (Any,), result) record(get_testset(), testres) end @@ -1360,6 +1360,7 @@ function testset_beginend_call(args, tests, source) err isa InterruptException && rethrow() # something in the test block threw an error. Count that as an # error in this test set + ccall(:jl_test_failure_breakpoint, Cvoid, (Any,), err) record(ts, Error(:nontest_error, Expr(:tuple), err, Base.current_exceptions(), $(QuoteNode(source)))) finally copy!(RNG, oldrng) @@ -1435,6 +1436,7 @@ function testset_forloop(args, testloop, source) err isa InterruptException && rethrow() # Something in the test block threw an error. Count that as an # error in this test set + ccall(:jl_test_failure_breakpoint, Cvoid, (Any,), err) record(ts, Error(:nontest_error, Expr(:tuple), err, Base.current_exceptions(), $(QuoteNode(source)))) end end