unittests: Do not import libnvim or headers in main process

Slows down unit tests much, but gets rid of as much preserved state as possible.
This commit is contained in:
ZyX
2017-03-11 16:02:47 +03:00
parent 9400466282
commit e2a578f40d
12 changed files with 361 additions and 313 deletions

View File

@@ -9,7 +9,7 @@ local ffi = helpers.ffi
local to_cstr = helpers.to_cstr
local NULL = helpers.NULL
local garray = cimport('stdlib.h', './src/nvim/garray.h')
local garray = cimport('./src/nvim/garray.h')
local itemsize = 14
local growsize = 95
@@ -157,7 +157,7 @@ local ga_append_ints = function(garr, ...)
end
-- enhanced constructors
local garray_ctype = ffi.typeof('garray_T[1]')
local garray_ctype = function(...) return ffi.typeof('garray_T[1]')(...) end
local new_garray = function()
local garr = garray_ctype()
return ffi.gc(garr, ga_clear)