mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
unittests: Do not use which, add data to paths.lua.in instead
This commit is contained in:
parent
ce12bda712
commit
ec730daee9
@ -8,6 +8,15 @@ end
|
||||
module.test_include_path = "${CMAKE_BINARY_DIR}/test/includes/post"
|
||||
module.test_libnvim_path = "${TEST_LIBNVIM_PATH}"
|
||||
module.test_source_path = "${CMAKE_SOURCE_DIR}"
|
||||
module.test_lua_prg = "${LUA_PRG}"
|
||||
module.test_luajit_prg = ""
|
||||
if module.test_luajit_prg == '' then
|
||||
if module.test_lua_prg:sub(-6) == 'luajit' then
|
||||
module.test_luajit_prg = module.test_lua_prg
|
||||
else
|
||||
module.test_luajit_prg = nil
|
||||
end
|
||||
end
|
||||
table.insert(module.include_paths, "${CMAKE_BINARY_DIR}/include")
|
||||
|
||||
return module
|
||||
|
@ -216,8 +216,11 @@ local function which(exe)
|
||||
local pipe = io.popen('which ' .. exe, 'r')
|
||||
local ret = pipe:read('*a')
|
||||
pipe:close()
|
||||
assert(ret:sub(-1) == '\n')
|
||||
return ret:sub(1, -2)
|
||||
if ret == '' then
|
||||
return nil
|
||||
else
|
||||
return ret:sub(1, -2)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
|
@ -520,7 +520,7 @@ local function gen_itp(it)
|
||||
if not err then
|
||||
if allow_failure then
|
||||
io.stderr:write('Errorred out:\n' .. tostring(emsg) .. '\n')
|
||||
os.execute([[sh -c "source .ci/common/test.sh ; check_core_dumps --delete \"\$(which luajit)\""]])
|
||||
os.execute([[sh -c "source .ci/common/test.sh ; check_core_dumps --delete \"]] .. Paths.test_luajit_prg .. [[\""]])
|
||||
else
|
||||
error(emsg)
|
||||
end
|
||||
@ -560,7 +560,7 @@ local module = {
|
||||
return function(after_each)
|
||||
if after_each then
|
||||
after_each(function()
|
||||
check_cores(which('luajit'))
|
||||
check_cores(Paths.test_luajit_prg)
|
||||
end)
|
||||
end
|
||||
return module
|
||||
|
Loading…
Reference in New Issue
Block a user