Skip to content

Commit

Permalink
Make it easier to create useful bug reports from Julia tests
Browse files Browse the repository at this point in the history
See the instructions in #13.
  • Loading branch information
timholy committed Feb 18, 2019
1 parent 7705307 commit 488b7a8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ function run_test_by_eval(test, fullpath, nstmts)
stack = JuliaStackFrame[]
for (i, modex) in enumerate(modexs) # having the index can be useful for debugging
nstmtsleft = $nstmts
# mod, ex = modex
# @show mod ex
frame = JuliaInterpreter.prepare_thunk(modex)
while true
yield() # allow communication between processes
Expand All @@ -198,3 +200,17 @@ function run_test_by_eval(test, fullpath, nstmts)
return ts, aborts
end))
end

# To help debugging
function run_compiled(frame)
Core.eval(moduleof(frame), Expr(:toplevel, quote
let pc = $frame.pc[]
while true # This is finish!, except we need to run it at top level
new_pc = ($_step_expr!)($(Compiled()), $frame, pc, true)
new_pc == nothing && break
pc = new_pc
end
$frame.pc[] = pc
end
end))
end

0 comments on commit 488b7a8

Please sign in to comment.