functests: Fix some tests which are failing locally for unrelated reasons

This commit is contained in:
ZyX 2017-04-09 01:55:19 +03:00
parent c35bd4d074
commit 69d1003bf7
5 changed files with 15 additions and 5 deletions

View File

@ -5,7 +5,8 @@ for p in ("${TEST_INCLUDE_DIRS}" .. ";"):gmatch("[^;]+") do
table.insert(module.include_paths, p) table.insert(module.include_paths, p)
end end
module.test_include_path = "${CMAKE_BINARY_DIR}/test/includes/post" module.test_build_dir = "${CMAKE_BINARY_DIR}"
module.test_include_path = module.test_build_dir .. "/test/includes/post"
module.test_libnvim_path = "${TEST_LIBNVIM_PATH}" module.test_libnvim_path = "${TEST_LIBNVIM_PATH}"
module.test_source_path = "${CMAKE_SOURCE_DIR}" module.test_source_path = "${CMAKE_SOURCE_DIR}"
module.test_lua_prg = "${LUA_PRG}" module.test_lua_prg = "${LUA_PRG}"

View File

@ -1,6 +1,8 @@
-- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate -- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate
-- `rpcrequest` calls we need the client event loop to be running. -- `rpcrequest` calls we need the client event loop to be running.
local helpers = require('test.functional.helpers')(after_each) local helpers = require('test.functional.helpers')(after_each)
local Paths = require('test.config.paths')
local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval
local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop
local nvim_prog, command, funcs = helpers.nvim_prog, helpers.command, helpers.funcs local nvim_prog, command, funcs = helpers.nvim_prog, helpers.command, helpers.funcs
@ -200,7 +202,7 @@ describe('server -> client', function()
\ 'rpc': v:true \ 'rpc': v:true
\ } \ }
]]) ]])
local lua_prog = arg[-1] local lua_prog = Paths.test_lua_prg
meths.set_var("args", {lua_prog, 'test/functional/api/rpc_fixture.lua'}) meths.set_var("args", {lua_prog, 'test/functional/api/rpc_fixture.lua'})
jobid = eval("jobstart(g:args, g:job_opts)") jobid = eval("jobstart(g:args, g:job_opts)")
neq(0, 'jobid') neq(0, 'jobid')

View File

@ -1,4 +1,6 @@
local helpers = require('test.functional.helpers')(after_each) local helpers = require('test.functional.helpers')(after_each)
local nvim_dir = helpers.nvim_dir
local eq, call, clear, eval, feed_command, feed, nvim = local eq, call, clear, eval, feed_command, feed, nvim =
helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command, helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command,
helpers.feed, helpers.nvim helpers.feed, helpers.nvim
@ -31,7 +33,7 @@ describe('system()', function()
describe('command passed as a List', function() describe('command passed as a List', function()
local function printargs_path() local function printargs_path()
return helpers.nvim_dir..'/printargs-test' return nvim_dir..'/printargs-test'
.. (helpers.os_name() == 'windows' and '.exe' or '') .. (helpers.os_name() == 'windows' and '.exe' or '')
end end

View File

@ -47,7 +47,7 @@ describe("CTRL-C (mapped)", function()
end end
-- The test is time-sensitive. Try different sleep values. -- The test is time-sensitive. Try different sleep values.
local ms_values = {1, 10, 100} local ms_values = {1, 10, 100, 1000, 10000}
for i, ms in ipairs(ms_values) do for i, ms in ipairs(ms_values) do
if i < #ms_values then if i < #ms_values then
local status, _ = pcall(test_ctrl_c, ms) local status, _ = pcall(test_ctrl_c, ms)

View File

@ -8,6 +8,7 @@ local Session = require('nvim.session')
local TcpStream = require('nvim.tcp_stream') local TcpStream = require('nvim.tcp_stream')
local SocketStream = require('nvim.socket_stream') local SocketStream = require('nvim.socket_stream')
local ChildProcessStream = require('nvim.child_process_stream') local ChildProcessStream = require('nvim.child_process_stream')
local Paths = require('test.config.paths')
local check_cores = global_helpers.check_cores local check_cores = global_helpers.check_cores
local check_logs = global_helpers.check_logs local check_logs = global_helpers.check_logs
@ -20,7 +21,11 @@ local dedent = global_helpers.dedent
local start_dir = lfs.currentdir() local start_dir = lfs.currentdir()
-- XXX: NVIM_PROG takes precedence, QuickBuild sets it. -- XXX: NVIM_PROG takes precedence, QuickBuild sets it.
local nvim_prog = os.getenv('NVIM_PROG') or os.getenv('NVIM_PRG') or 'build/bin/nvim' local nvim_prog = (
os.getenv('NVIM_PROG')
or os.getenv('NVIM_PRG')
or Paths.test_build_dir .. '/bin/nvim'
)
-- Default settings for the test session. -- Default settings for the test session.
local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent' local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent'
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.' ..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'