mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: refactor Paths
This commit is contained in:
parent
b990a1f286
commit
96ad7e0a4a
@ -18,7 +18,7 @@ local fail = global_helpers.fail
|
|||||||
local module = {}
|
local module = {}
|
||||||
|
|
||||||
local runtime_set = 'set runtimepath^=./build/lib/nvim/'
|
local runtime_set = 'set runtimepath^=./build/lib/nvim/'
|
||||||
module.nvim_prog = (os.getenv('NVIM_PRG') or global_helpers.test_build_dir .. '/bin/nvim')
|
module.nvim_prog = (os.getenv('NVIM_PRG') or global_helpers.paths.test_build_dir .. '/bin/nvim')
|
||||||
-- Default settings for the test session.
|
-- Default settings for the test session.
|
||||||
module.nvim_set = (
|
module.nvim_set = (
|
||||||
'set shortmess+=IS background=light termguicolors noswapfile noautoindent startofline'
|
'set shortmess+=IS background=light termguicolors noswapfile noautoindent startofline'
|
||||||
@ -915,7 +915,7 @@ end
|
|||||||
|
|
||||||
function module.add_builddir_to_rtp()
|
function module.add_builddir_to_rtp()
|
||||||
-- Add runtime from build dir for doc/tags (used with :help).
|
-- Add runtime from build dir for doc/tags (used with :help).
|
||||||
module.command(string.format([[set rtp+=%s/runtime]], module.test_build_dir))
|
module.command(string.format([[set rtp+=%s/runtime]], module.paths.test_build_dir))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Kill (reap) a process by PID.
|
-- Kill (reap) a process by PID.
|
||||||
|
@ -6,8 +6,8 @@ local eq = helpers.eq
|
|||||||
local mkdir_p = helpers.mkdir_p
|
local mkdir_p = helpers.mkdir_p
|
||||||
local rmdir = helpers.rmdir
|
local rmdir = helpers.rmdir
|
||||||
local nvim_dir = helpers.nvim_dir
|
local nvim_dir = helpers.nvim_dir
|
||||||
local test_build_dir = helpers.test_build_dir
|
local test_build_dir = helpers.paths.test_build_dir
|
||||||
local test_source_path = helpers.test_source_path
|
local test_source_path = helpers.paths.test_source_path
|
||||||
local nvim_prog = helpers.nvim_prog
|
local nvim_prog = helpers.nvim_prog
|
||||||
local is_os = helpers.is_os
|
local is_os = helpers.is_os
|
||||||
local mkdir = helpers.mkdir
|
local mkdir = helpers.mkdir
|
||||||
|
@ -7,7 +7,7 @@ local is_os = helpers.is_os
|
|||||||
local skip = helpers.skip
|
local skip = helpers.skip
|
||||||
|
|
||||||
local uv = vim.uv
|
local uv = vim.uv
|
||||||
local paths = require('test.cmakeconfig.paths')
|
local paths = helpers.paths
|
||||||
|
|
||||||
local shada_helpers = require('test.functional.shada.helpers')
|
local shada_helpers = require('test.functional.shada.helpers')
|
||||||
local reset, clear, get_shada_rw =
|
local reset, clear, get_shada_rw =
|
||||||
|
@ -7,7 +7,7 @@ local command = helpers.command
|
|||||||
local set_method_error = helpers.set_method_error
|
local set_method_error = helpers.set_method_error
|
||||||
local api = helpers.api
|
local api = helpers.api
|
||||||
local async_meths = helpers.async_meths
|
local async_meths = helpers.async_meths
|
||||||
local test_build_dir = helpers.test_build_dir
|
local test_build_dir = helpers.paths.test_build_dir
|
||||||
local nvim_prog = helpers.nvim_prog
|
local nvim_prog = helpers.nvim_prog
|
||||||
local exec = helpers.exec
|
local exec = helpers.exec
|
||||||
local exec_capture = helpers.exec_capture
|
local exec_capture = helpers.exec_capture
|
||||||
|
@ -19,6 +19,7 @@ end
|
|||||||
--- @class test.helpers
|
--- @class test.helpers
|
||||||
local module = {
|
local module = {
|
||||||
REMOVE_THIS = {},
|
REMOVE_THIS = {},
|
||||||
|
paths = Paths,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- @param p string
|
--- @param p string
|
||||||
@ -952,6 +953,4 @@ function module.mkdir(path)
|
|||||||
return uv.fs_mkdir(path, 493)
|
return uv.fs_mkdir(path, 493)
|
||||||
end
|
end
|
||||||
|
|
||||||
module = vim.tbl_extend('error', module, Paths)
|
|
||||||
|
|
||||||
return module
|
return module
|
||||||
|
@ -2,8 +2,8 @@ local ffi = require('ffi')
|
|||||||
local formatc = require('test.unit.formatc')
|
local formatc = require('test.unit.formatc')
|
||||||
local Set = require('test.unit.set')
|
local Set = require('test.unit.set')
|
||||||
local Preprocess = require('test.unit.preprocess')
|
local Preprocess = require('test.unit.preprocess')
|
||||||
local Paths = require('test.cmakeconfig.paths')
|
|
||||||
local global_helpers = require('test.helpers')
|
local global_helpers = require('test.helpers')
|
||||||
|
local paths = global_helpers.paths
|
||||||
local assert = require('luassert')
|
local assert = require('luassert')
|
||||||
local say = require('say')
|
local say = require('say')
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ local eq = global_helpers.eq
|
|||||||
local trim = vim.trim
|
local trim = vim.trim
|
||||||
|
|
||||||
-- add some standard header locations
|
-- add some standard header locations
|
||||||
for _, p in ipairs(Paths.include_paths) do
|
for _, p in ipairs(paths.include_paths) do
|
||||||
Preprocess.add_to_include_path(p)
|
Preprocess.add_to_include_path(p)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ local function check_child_err(rd)
|
|||||||
--- @type string
|
--- @type string
|
||||||
err = err .. '\nNo end of trace occurred'
|
err = err .. '\nNo end of trace occurred'
|
||||||
end
|
end
|
||||||
local cc_err, cc_emsg = pcall(check_cores, Paths.test_luajit_prg, true)
|
local cc_err, cc_emsg = pcall(check_cores, paths.test_luajit_prg, true)
|
||||||
if not cc_err then
|
if not cc_err then
|
||||||
--- @type string
|
--- @type string
|
||||||
err = err .. '\ncheck_cores failed: ' .. cc_emsg
|
err = err .. '\ncheck_cores failed: ' .. cc_emsg
|
||||||
@ -749,7 +749,7 @@ local function itp_parent(rd, pid, allow_failure, location)
|
|||||||
io.stderr:write('Errorred out (' .. status .. '):\n' .. tostring(emsg) .. '\n')
|
io.stderr:write('Errorred out (' .. status .. '):\n' .. tostring(emsg) .. '\n')
|
||||||
os.execute([[
|
os.execute([[
|
||||||
sh -c "source ci/common/test.sh
|
sh -c "source ci/common/test.sh
|
||||||
check_core_dumps --delete \"]] .. Paths.test_luajit_prg .. [[\""]])
|
check_core_dumps --delete \"]] .. paths.test_luajit_prg .. [[\""]])
|
||||||
else
|
else
|
||||||
error(tostring(emsg) .. '\nexit code: ' .. status)
|
error(tostring(emsg) .. '\nexit code: ' .. status)
|
||||||
end
|
end
|
||||||
@ -797,7 +797,7 @@ local function gen_itp(it)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function cppimport(path)
|
local function cppimport(path)
|
||||||
return cimport(Paths.test_source_path .. '/test/includes/pre/' .. path)
|
return cimport(paths.test_source_path .. '/test/includes/pre/' .. path)
|
||||||
end
|
end
|
||||||
|
|
||||||
cimport(
|
cimport(
|
||||||
|
Loading…
Reference in New Issue
Block a user