unit tests: initialize everything

This commit is contained in:
Justin M. Keyes 2014-09-10 01:17:07 +00:00
parent f6088e79b0
commit 99a9161bac
4 changed files with 22 additions and 13 deletions

View File

@ -9,11 +9,6 @@ local buffer = helpers.cimport("./src/nvim/buffer.h")
local window = helpers.cimport("./src/nvim/window.h")
local option = helpers.cimport("./src/nvim/option.h")
--{ Initialize the options needed for interacting with buffers
window.win_alloc_first()
option.set_init_1()
--}
describe('buffer functions', function()
local buflist_new = function(file, flags)

View File

@ -127,8 +127,25 @@ local function vim_init()
return
end
-- import os_unix.h for mch_early_init(), which initializes some globals
local os = cimport('./src/nvim/os_unix.h')
os.mch_early_init()
local all = cimport('./src/nvim/os_unix.h',
'./src/nvim/misc1.h',
'./src/nvim/eval.h',
'./src/nvim/os_unix.h',
'./src/nvim/option.h',
'./src/nvim/ex_cmds2.h',
'./src/nvim/window.h',
'./src/nvim/ops.h',
'./src/nvim/normal.h',
'./src/nvim/mbyte.h')
all.mch_early_init()
all.mb_init()
all.eval_init()
all.init_normal_cmds()
all.win_alloc_first()
all.init_yank()
all.init_homedir()
all.set_init_1()
all.set_lang_var()
vim_init_called = true
end

View File

@ -24,11 +24,7 @@ local NULL = ffi.cast('void *', 0)
describe('shell functions', function()
setup(function()
-- the logging functions are complain if I don't do this
shell.init_homedir()
shell.event_init()
-- os_system() can't work when the p_sh and p_shcf variables are unset
shell.p_sh = to_cstr('/bin/bash')
shell.p_shcf = to_cstr('-c')

View File

@ -3,11 +3,12 @@ local helpers = require 'test.unit.helpers'
local os = helpers.cimport './src/nvim/os/os.h'
local tempfile = helpers.cimport './src/nvim/tempfile.h'
-- os.mch_early_init
helpers.vim_init()
describe('tempfile related functions', function()
after_each(function()
-- tempfile.vim_deltempdir()
tempfile.vim_deltempdir()
end)
local vim_gettempdir = function()