build: fix running of functional tests directly with CMake

If you aren't just building everything into build/, then the functional
tests fail because they can't find the nvim executable.  Let's pass in
the location of the nvim executable, and set NVIM_PRG environment
variable accordingly.
This commit is contained in:
John Szakmeister 2014-11-05 07:26:35 -05:00
parent d1675de0a9
commit 5ba1d980fb
2 changed files with 5 additions and 0 deletions

View File

@ -252,6 +252,7 @@ if(BUSTED_PRG)
add_custom_target(functionaltest
COMMAND ${CMAKE_COMMAND}
-DBUSTED_PRG=${BUSTED_PRG}
-DNVIM_PRG=$<TARGET_FILE:nvim>
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test

View File

@ -1,5 +1,9 @@
get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
if(NVIM_PRG)
set(ENV{NVIM_PROG} "${NVIM_PRG}")
endif()
if(DEFINED ENV{TEST_FILE})
set(TEST_DIR $ENV{TEST_FILE})
endif()