2014-09-29 05:43:52 -07:00
|
|
|
get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
|
|
|
|
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
|
2014-11-05 05:50:33 -07:00
|
|
|
|
2014-11-04 11:44:43 -07:00
|
|
|
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
|
|
|
|
2014-11-05 05:26:35 -07:00
|
|
|
if(NVIM_PRG)
|
|
|
|
set(ENV{NVIM_PROG} "${NVIM_PRG}")
|
|
|
|
endif()
|
|
|
|
|
2014-09-29 05:43:52 -07:00
|
|
|
if(DEFINED ENV{TEST_FILE})
|
2014-11-05 05:50:33 -07:00
|
|
|
set(TEST_PATH "$ENV{TEST_FILE}")
|
2014-09-29 05:43:52 -07:00
|
|
|
else()
|
2014-11-05 05:50:33 -07:00
|
|
|
set(TEST_PATH "${TEST_DIR}/${TEST_TYPE}")
|
2014-09-29 05:43:52 -07:00
|
|
|
endif()
|
|
|
|
|
2014-11-05 05:50:33 -07:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${BUSTED_PRG} -v -o ${BUSTED_OUTPUT_TYPE}
|
|
|
|
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
|
|
|
|
WORKING_DIRECTORY ${WORKING_DIR}
|
|
|
|
RESULT_VARIABLE res)
|
|
|
|
|
2014-09-29 05:43:52 -07:00
|
|
|
if(NOT res EQUAL 0)
|
2014-11-05 05:50:33 -07:00
|
|
|
message(FATAL_ERROR "Running ${TEST_TYPE} tests failed.")
|
2014-09-29 05:43:52 -07:00
|
|
|
endif()
|