diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-10 22:21:06 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-10 22:21:06 +0300 |
commit | ab4d13e2fa09db538756cc5cfb36f81681e5ff7a (patch) | |
tree | b8bded415655f09bc323a23d21ed8d7e74b1c8da /test/functional/helpers.lua | |
parent | a40a969e9a4776f1e274dcf0e59c8f1ec1770ca0 (diff) | |
parent | 9aface8c4d1edd25d4fed3e099e3c2c02b0a282a (diff) | |
download | rneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.tar.gz rneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.tar.bz2 rneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.zip |
Merge branch 'master' into luaviml'/lua
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 2e308186fe..a23f0e1215 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -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=.' @@ -246,12 +251,13 @@ local function retry(max, max_ms, fn) return result end if (max and tries >= max) or (luv.now() - start_time > timeout) then - break + if type(result) == "string" then + result = "\nretry() attempts: "..tostring(tries).."\n"..result + end + error(result) end tries = tries + 1 end - -- Do not use pcall() for the final attempt, let the failure bubble up. - return fn() end local function clear(...) @@ -304,7 +310,7 @@ end -- Executes an ex-command by user input. Because nvim_input() is used, VimL -- errors will not manifest as client (lua) errors. Use command() for that. -local function execute(...) +local function feed_command(...) for _, v in ipairs({...}) do if v:sub(1, 1) ~= '/' then -- not a search command, prefix with colon @@ -565,7 +571,7 @@ local module = { insert = insert, iswin = iswin, feed = feed, - execute = execute, + feed_command = feed_command, eval = nvim_eval, call = nvim_call, command = nvim_command, |