Browse Source

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

tags/v0.2.0
ZyX 2 years ago
parent
commit
69d1003bf7
5 changed files with 15 additions and 5 deletions
  1. +2
    -1
      test/config/paths.lua.in
  2. +3
    -1
      test/functional/api/server_requests_spec.lua
  3. +3
    -1
      test/functional/eval/system_spec.lua
  4. +1
    -1
      test/functional/ex_cmds/ctrl_c_spec.lua
  5. +6
    -1
      test/functional/helpers.lua

+ 2
- 1
test/config/paths.lua.in View File

@@ -5,7 +5,8 @@ for p in ("${TEST_INCLUDE_DIRS}" .. ";"):gmatch("[^;]+") do
table.insert(module.include_paths, p)
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_source_path = "${CMAKE_SOURCE_DIR}"
module.test_lua_prg = "${LUA_PRG}"

+ 3
- 1
test/functional/api/server_requests_spec.lua View File

@@ -1,6 +1,8 @@
-- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate
-- `rpcrequest` calls we need the client event loop to be running.
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 eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop
local nvim_prog, command, funcs = helpers.nvim_prog, helpers.command, helpers.funcs
@@ -200,7 +202,7 @@ describe('server -> client', function()
\ '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'})
jobid = eval("jobstart(g:args, g:job_opts)")
neq(0, 'jobid')

+ 3
- 1
test/functional/eval/system_spec.lua View File

@@ -1,4 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)

local nvim_dir = helpers.nvim_dir
local eq, call, clear, eval, feed_command, feed, nvim =
helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command,
helpers.feed, helpers.nvim
@@ -31,7 +33,7 @@ describe('system()', function()

describe('command passed as a List', function()
local function printargs_path()
return helpers.nvim_dir..'/printargs-test'
return nvim_dir..'/printargs-test'
.. (helpers.os_name() == 'windows' and '.exe' or '')
end


+ 1
- 1
test/functional/ex_cmds/ctrl_c_spec.lua View File

@@ -47,7 +47,7 @@ describe("CTRL-C (mapped)", function()
end

-- 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
if i < #ms_values then
local status, _ = pcall(test_ctrl_c, ms)

+ 6
- 1
test/functional/helpers.lua View File

@@ -8,6 +8,7 @@ local Session = require('nvim.session')
local TcpStream = require('nvim.tcp_stream')
local SocketStream = require('nvim.socket_stream')
local ChildProcessStream = require('nvim.child_process_stream')
local Paths = require('test.config.paths')

local check_cores = global_helpers.check_cores
local check_logs = global_helpers.check_logs
@@ -20,7 +21,11 @@ local dedent = global_helpers.dedent

local start_dir = lfs.currentdir()
-- 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.
local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent'
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'

Loading…
Cancel
Save