diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-06 08:23:33 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-08 04:48:58 +0300 |
commit | a83511d1a19d6277f8258f2c5b970c936f0bc56e (patch) | |
tree | 6496ed79e44574e60731f8327bb00ab676c9558e | |
parent | 654dd15bb8e82538942b1933b7f69c63d51b6608 (diff) | |
download | rneovim-a83511d1a19d6277f8258f2c5b970c936f0bc56e.tar.gz rneovim-a83511d1a19d6277f8258f2c5b970c936f0bc56e.tar.bz2 rneovim-a83511d1a19d6277f8258f2c5b970c936f0bc56e.zip |
unittests: Move checking cores to check_child_err
-rw-r--r-- | test/helpers.lua | 4 | ||||
-rw-r--r-- | test/unit/helpers.lua | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/test/helpers.lua b/test/helpers.lua index 3fc10e9e30..beef53b5a9 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -162,7 +162,7 @@ end local tests_skipped = 0 -local function check_cores(app) +local function check_cores(app, force) app = app or 'build/bin/nvim' local initial_path, re, exc_re local gdb_db_cmd = 'gdb -n -batch -ex "thread apply all bt full" "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE"' @@ -188,7 +188,7 @@ local function check_cores(app) random_skip = true end -- Finding cores takes too much time on linux - if random_skip and math.random() < 0.9 then + if not force and random_skip and math.random() < 0.9 then tests_skipped = tests_skipped + 1 return end diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 6d0de5c651..4b9f185156 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -655,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 @@ -665,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 @@ -680,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 @@ -765,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 |