2017-07-28 15:34:14 -07:00
|
|
|
# Set LC_ALL to meet expectations of some locale-sensitive tests.
|
|
|
|
set(ENV{LC_ALL} "en_US.UTF-8")
|
|
|
|
|
2014-11-04 11:44:43 -07:00
|
|
|
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
2016-08-15 20:25:02 -07:00
|
|
|
set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
|
|
|
|
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
|
|
|
|
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
|
2014-11-04 11:44:43 -07:00
|
|
|
|
2017-05-31 01:45:20 -07:00
|
|
|
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
|
|
|
set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog)
|
|
|
|
endif()
|
|
|
|
|
2014-11-05 05:26:35 -07:00
|
|
|
if(NVIM_PRG)
|
2017-02-11 17:02:54 -07:00
|
|
|
set(ENV{NVIM_PRG} "${NVIM_PRG}")
|
2014-11-05 05:26:35 -07:00
|
|
|
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()
|
|
|
|
|
2015-03-21 06:47:49 -07:00
|
|
|
if(BUSTED_OUTPUT_TYPE STREQUAL junit)
|
|
|
|
set(EXTRA_ARGS OUTPUT_FILE ${BUILD_DIR}/${TEST_TYPE}test-junit.xml)
|
|
|
|
endif()
|
|
|
|
|
2018-06-15 16:45:50 -07:00
|
|
|
if(DEFINED ENV{TEST_TAG} AND NOT "$ENV{TEST_TAG}" STREQUAL "")
|
2015-03-17 04:48:03 -07:00
|
|
|
set(TEST_TAG "--tags=$ENV{TEST_TAG}")
|
|
|
|
endif()
|
|
|
|
|
2018-06-15 16:45:50 -07:00
|
|
|
if(DEFINED ENV{TEST_FILTER} AND NOT "$ENV{TEST_FILTER}" STREQUAL "")
|
|
|
|
set(TEST_FILTER "--filter=$ENV{TEST_FILTER}")
|
2015-03-17 04:48:03 -07:00
|
|
|
endif()
|
|
|
|
|
2017-03-29 11:07:39 -07:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKING_DIR}/Xtest-tmpdir)
|
|
|
|
set(ENV{TMPDIR} ${WORKING_DIR}/Xtest-tmpdir)
|
2015-12-29 12:18:16 -07:00
|
|
|
set(ENV{SYSTEM_NAME} ${SYSTEM_NAME})
|
2014-11-05 05:50:33 -07:00
|
|
|
execute_process(
|
2015-03-17 04:48:03 -07:00
|
|
|
COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
|
2016-07-13 00:37:50 -07:00
|
|
|
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
|
2018-01-20 06:43:16 -07:00
|
|
|
--lpath=${BUILD_DIR}/?.lua --lpath=?.lua ${TEST_PATH}
|
2014-11-05 05:50:33 -07:00
|
|
|
WORKING_DIRECTORY ${WORKING_DIR}
|
2015-02-06 04:17:48 -07:00
|
|
|
ERROR_VARIABLE err
|
2015-03-21 06:47:49 -07:00
|
|
|
RESULT_VARIABLE res
|
|
|
|
${EXTRA_ARGS})
|
2014-11-05 05:50:33 -07:00
|
|
|
|
2016-08-15 20:25:02 -07:00
|
|
|
file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest)
|
|
|
|
file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg)
|
2017-03-29 11:07:39 -07:00
|
|
|
file(REMOVE_RECURSE ${WORKING_DIR}/Xtest-tmpdir)
|
2016-08-15 20:25:02 -07:00
|
|
|
|
2014-09-29 05:43:52 -07:00
|
|
|
if(NOT res EQUAL 0)
|
2015-02-06 04:17:48 -07:00
|
|
|
message(STATUS "Output to stderr:\n${err}")
|
2018-10-06 09:45:34 -07:00
|
|
|
message(FATAL_ERROR "${TEST_TYPE} tests failed with error: ${res}")
|
2014-09-29 05:43:52 -07:00
|
|
|
endif()
|