test: use $TEST_TIMEOUT to specify timeout

This commit is contained in:
James McCoy 2021-09-09 20:49:26 -04:00 committed by Justin M. Keyes
parent 09ff3146f3
commit cd864748d3
2 changed files with 8 additions and 1 deletions

View File

@ -49,6 +49,10 @@ endif()
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "")
set(ENV{TEST_TIMEOUT} 1200)
endif()
set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/helpers.lua.
execute_process(
COMMAND ${BUSTED_PRG} -v -o test.busted.outputHandlers.${BUSTED_OUTPUT_TYPE}
@ -58,7 +62,7 @@ execute_process(
--lpath=?.lua
${BUSTED_ARGS}
${TEST_PATH}
TIMEOUT 1200
TIMEOUT $ENV{TEST_TIMEOUT}
WORKING_DIRECTORY ${WORKING_DIR}
ERROR_VARIABLE err
RESULT_VARIABLE res

View File

@ -258,6 +258,9 @@ Number; !must be defined to function properly):
- `TEST_SKIP_FRAGILE` (F) (D): makes test suite skip some fragile tests.
- `TEST_TIMEOUT` (FU) (I): specifies maximum time, in seconds, before the test
suite run is killed
- `NVIM_PROG`, `NVIM_PRG` (F) (S): override path to Neovim executable (default
to `build/bin/nvim`).