mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
unittests: Avoid infinite cycle somewhere because of init failure
This commit is contained in:
parent
ebb33eddd9
commit
7c20f60b88
@ -644,13 +644,15 @@ local function itp_child(wr, func)
|
|||||||
s = s:sub(1, hook_msglen - 2)
|
s = s:sub(1, hook_msglen - 2)
|
||||||
sc.write(wr, '>' .. s .. (' '):rep(hook_msglen - 2 - #s) .. '\n')
|
sc.write(wr, '>' .. s .. (' '):rep(hook_msglen - 2 - #s) .. '\n')
|
||||||
end
|
end
|
||||||
init()
|
local err, emsg = pcall(init)
|
||||||
collectgarbage('stop')
|
if err then
|
||||||
child_sethook(wr)
|
collectgarbage('stop')
|
||||||
local err, emsg = pcall(func)
|
child_sethook(wr)
|
||||||
collectgarbage('restart')
|
err, emsg = pcall(func)
|
||||||
collectgarbage()
|
collectgarbage('restart')
|
||||||
debug.sethook()
|
collectgarbage()
|
||||||
|
debug.sethook()
|
||||||
|
end
|
||||||
emsg = tostring(emsg)
|
emsg = tostring(emsg)
|
||||||
sc.write(wr, trace_end_msg)
|
sc.write(wr, trace_end_msg)
|
||||||
if not err then
|
if not err then
|
||||||
|
Loading…
Reference in New Issue
Block a user