aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2015-03-01 15:24:00 -0500
committerJohn Szakmeister <john@szakmeister.net>2015-03-01 15:24:00 -0500
commitea35062589142459ca657f3977d76636bf9bd29d (patch)
tree52d81c9bf318b526c2229c7207dc47d7f224f752 /test/functional/helpers.lua
parent32951edc9d653718b60da433c4b16a6a690b26d8 (diff)
parentc1e8d12aa342e006f07856bfc0f129b5de5324b5 (diff)
downloadrneovim-ea35062589142459ca657f3977d76636bf9bd29d.tar.gz
rneovim-ea35062589142459ca657f3977d76636bf9bd29d.tar.bz2
rneovim-ea35062589142459ca657f3977d76636bf9bd29d.zip
Merge pull request #2075 from jszakmeister/dont-hardcode-tty-test-path
tests: don't hardcode the path to tty-test
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 508bb6e593..5627b1fae2 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -9,6 +9,15 @@ local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim'
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
'--cmd', 'set shortmess+=I background=light noswapfile',
'--embed'}
+
+-- Formulate a path to the directory containing nvim. We use this to
+-- help run test executables. It helps to keep the tests working, even
+-- when the build is not in the default location.
+local nvim_dir = nvim_prog:gsub("[/\\][^/\\]+$", "")
+if nvim_dir == nvim_prog then
+ nvim_dir = "."
+end
+
local prepend_argv
if os.getenv('VALGRIND') then
@@ -283,6 +292,7 @@ return {
expect = expect,
ok = ok,
nvim = nvim,
+ nvim_dir = nvim_dir,
buffer = buffer,
window = window,
tabpage = tabpage,