Skip to content

Commit

Permalink
Execute backtrace once before testing formatting (#38886)
Browse files Browse the repository at this point in the history
On some platforms (PowerPC) the call to the `jlplt` is not a tail-call
and so it will be part of the backtrace. This means we are off-by-one
and won't skip the Julia function `backtrace` messing up tests that
check precise formatting.

(cherry picked from commit fc577d0)
  • Loading branch information
vchuravy authored and staticfloat committed Jan 15, 2021
1 parent 186c38b commit 03bcd7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stdlib/Logging/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ end
└ SUFFIX
"""

# Execute backtrace once before checking formatting, see #3885
backtrace()

# Attaching backtraces
bt = func1()
@test startswith(genmsg("msg", exception=(DivideError(),bt)),
Expand Down
2 changes: 2 additions & 0 deletions test/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ catch ex
end
pop!(Base.Experimental._hint_handlers[DomainError]) # order is undefined, don't copy this

# Execute backtrace once before checking formatting, see #38858
backtrace()

# issue #28442
@testset "Long stacktrace printing" begin
Expand Down

0 comments on commit 03bcd7f

Please sign in to comment.