diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/busted_runner.lua | 1 | ||||
-rw-r--r-- | test/cmakeconfig/paths.lua.in | 1 | ||||
-rw-r--r-- | test/functional/core/startup_spec.lua | 7 | ||||
-rw-r--r-- | test/unit/eval/typval_spec.lua | 5 | ||||
-rw-r--r-- | test/unit/helpers.lua | 5 | ||||
-rw-r--r-- | test/unit/tui_spec.lua | 2 |
6 files changed, 12 insertions, 9 deletions
diff --git a/test/busted_runner.lua b/test/busted_runner.lua new file mode 100644 index 0000000000..b195ce3cc5 --- /dev/null +++ b/test/busted_runner.lua @@ -0,0 +1 @@ +require 'busted.runner'({ standalone = false }) diff --git a/test/cmakeconfig/paths.lua.in b/test/cmakeconfig/paths.lua.in index 6be238d838..a35dbe8901 100644 --- a/test/cmakeconfig/paths.lua.in +++ b/test/cmakeconfig/paths.lua.in @@ -6,7 +6,6 @@ for p in ("${TEST_INCLUDE_DIRS}" .. ";"):gmatch("[^;]+") do end module.test_build_dir = "${CMAKE_BINARY_DIR}" -module.test_libnvim_path = "${TEST_LIBNVIM_PATH}" module.test_source_path = "${CMAKE_SOURCE_DIR}" module.test_lua_prg = "${LUA_PRG}" module.test_luajit_prg = "" diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 1be5de6488..e9b47a0251 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -102,6 +102,13 @@ describe('startup', function() end) it('os.exit() sets Nvim exitcode', function() + -- tricky: LeakSanitizer triggers on os.exit() and disrupts the return value, disable it + exec_lua [[ + local asan_options = os.getenv 'ASAN_OPTIONS' + if asan_options ~= nil and asan_options ~= '' then + vim.loop.os_setenv('ASAN_OPTIONS', asan_options..':detect_leaks=0') + end + ]] -- nvim -l foo.lua -arg1 -- a b c assert_l_out([[ bufs: diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 128625374e..825377813d 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1677,7 +1677,7 @@ describe('typval.c', function() eq(nil, lib.tv_dict_find(nil, 'test', -1)) eq(nil, lib.tv_dict_find(nil, nil, 0)) end) - itp('works with NULL key', function() + itp('works with empty key', function() local lua_d = { ['']=0, t=1, @@ -1692,7 +1692,6 @@ describe('typval.c', function() alloc_log:check({}) local dis = dict_items(d) eq({0, '', dis['']}, {tv_dict_find(d, '', 0)}) - eq({0, '', dis['']}, {tv_dict_find(d, nil, 0)}) end) itp('works with len properly', function() local lua_d = { @@ -1911,8 +1910,6 @@ describe('typval.c', function() local d = dict(lua_d) eq(lua_d, dct2tbl(d)) eq({{type='fref', fref='tr'}, true}, - {tv_dict_get_callback(d, nil, 0)}) - eq({{type='fref', fref='tr'}, true}, {tv_dict_get_callback(d, '', -1)}) eq({{type='none'}, true}, {tv_dict_get_callback(d, 'x', -1)}) diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua index 14d8eda357..686af3b461 100644 --- a/test/unit/helpers.lua +++ b/test/unit/helpers.lua @@ -75,7 +75,8 @@ local function child_cleanup_once(func, ...) end end -local libnvim = nil +-- Unittests are run from debug nvim binary in lua interpreter mode. +local libnvim = ffi.C local lib = setmetatable({}, { __index = only_separate(function(_, idx) @@ -87,8 +88,6 @@ local lib = setmetatable({}, { }) local init = only_separate(function() - -- load neovim shared library - libnvim = ffi.load(Paths.test_libnvim_path) for _, c in ipairs(child_calls_init) do c.func(unpack(c.args)) end diff --git a/test/unit/tui_spec.lua b/test/unit/tui_spec.lua index 25b70a17c2..192e35a485 100644 --- a/test/unit/tui_spec.lua +++ b/test/unit/tui_spec.lua @@ -12,7 +12,7 @@ local multiqueue = cimport("./test/unit/fixtures/multiqueue.h") local ui_client = cimport("./src/nvim/ui_client.h") itp('handle_background_color', function() - local handle_background_color = cinput.ut_handle_background_color + local handle_background_color = cinput.handle_background_color local term_input = ffi.new('TermInput', {}) local events = globals.main_loop.thread_events local kIncomplete = cinput.kIncomplete |