From e31aab8b61565766bbd411fae38550f9ae802dd9 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 8 Apr 2017 22:00:50 +0300 Subject: functests: Refactor legacy/029_join test --- test/functional/helpers.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 335cf3c3ff..7793a9a739 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -304,7 +304,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 +565,8 @@ local M = { insert = insert, iswin = iswin, feed = feed, - execute = execute, + feed_command = feed_command, + execute = feed_command, -- FIXME Remove eval = nvim_eval, call = nvim_call, command = nvim_command, -- cgit From a34408ef7f5ce25462beedff44db552f11424f3f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 9 Apr 2017 02:11:08 +0200 Subject: test: retry(): Report number of retries. (#6475) tui_spec.lua: Retry the terminal-mode test. --- test/functional/helpers.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 335cf3c3ff..42ed1800d3 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -246,12 +246,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(...) -- cgit From 65fb622000af8e3dbb65480e1581758ecf4ba3e2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 00:12:26 +0300 Subject: functests: Replace execute with either command or feed_command Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed. --- test/functional/helpers.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 7793a9a739..adabfde9f7 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -566,7 +566,6 @@ local M = { iswin = iswin, feed = feed, feed_command = feed_command, - execute = feed_command, -- FIXME Remove eval = nvim_eval, call = nvim_call, command = nvim_command, -- cgit From 69d1003bf79b7466d2fea45f94aeddbedd246049 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 01:55:19 +0300 Subject: functests: Fix some tests which are failing locally for unrelated reasons --- test/functional/helpers.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index adabfde9f7..13e6f36510 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=.' -- cgit