diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-09 19:14:20 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-09 19:14:20 +0300 |
commit | dbe67868b53774443521129ef30d74346592e3bb (patch) | |
tree | 2e375812cdb1b4d2e7203cf960560507888d2d02 /test/unit/helpers.lua | |
parent | f5be643205e98fcecc41c0b7ce19a5a22f692f2c (diff) | |
parent | 26bf6e6f6f8819a758611a88e0c0b04e38d4b915 (diff) | |
download | rneovim-dbe67868b53774443521129ef30d74346592e3bb.tar.gz rneovim-dbe67868b53774443521129ef30d74346592e3bb.tar.bz2 rneovim-dbe67868b53774443521129ef30d74346592e3bb.zip |
Merge branch 'master' into rename-execute
Diffstat (limited to 'test/unit/helpers.lua')
-rw-r--r-- | test/unit/helpers.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 74f214a231..4b9f185156 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -632,8 +632,9 @@ local function itp_child(wr, func) collectgarbage('stop') child_sethook(wr) local err, emsg = pcall(func) - debug.sethook() collectgarbage('restart') + collectgarbage() + debug.sethook() emsg = tostring(emsg) sc.write(wr, trace_end_msg) if not err then @@ -654,6 +655,7 @@ end local function check_child_err(rd) local trace = {} + local did_traceline = false while true do local traceline = sc.read(rd, hook_msglen) if #traceline ~= hook_msglen then @@ -664,6 +666,7 @@ local function check_child_err(rd) end end if traceline == trace_end_msg then + did_traceline = true break end trace[#trace + 1] = traceline @@ -679,6 +682,13 @@ local function check_child_err(rd) error = error .. trace[i] end end + if not did_traceline then + error = error .. '\nNo end of trace occurred' + end + local cc_err, cc_emsg = pcall(check_cores, Paths.test_luajit_prg, true) + if not cc_err then + error = error .. '\ncheck_cores failed: ' .. cc_emsg + end assert.just_fail(error) end if res == '+\n' then @@ -764,11 +774,6 @@ local module = { child_cleanup_once = child_cleanup_once, sc = sc, } -return function(after_each) - if after_each then - after_each(function() - check_cores(Paths.test_luajit_prg) - end) - end +return function() return module end |