From c1e8d12aa342e006f07856bfc0f129b5de5324b5 Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Sat, 28 Feb 2015 09:39:04 -0500 Subject: tests: don't hardcode the path to tty-test This fixes the build for those who drive the build directly using CMake. --- test/functional/helpers.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index fc6bf80d7e..59723dca20 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -8,6 +8,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 @@ -282,6 +291,7 @@ return { expect = expect, ok = ok, nvim = nvim, + nvim_dir = nvim_dir, buffer = buffer, window = window, tabpage = tabpage, -- cgit