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