GitHub Actions: Set timeout for running tests

Timeout of 5s for tests that do not have the TIMEOUT property,
and 600s for the whole teset suite.

Change-Id: Ie58f1ec2f657448a963bf51d6e93cad142603120
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Cristian Adam
2020-10-21 20:35:28 +02:00
parent 79ed00e14d
commit ee735e308e

View File

@@ -426,12 +426,13 @@ jobs:
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
execute_process( execute_process(
COMMAND ctest -j ${N} COMMAND ctest -j ${N} --timeout 5
WORKING_DIRECTORY build/build WORKING_DIRECTORY build/build
RESULT_VARIABLE result RESULT_VARIABLE result
OUTPUT_VARIABLE output OUTPUT_VARIABLE output
ERROR_VARIABLE output ERROR_VARIABLE output
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
TIMEOUT 600
) )
if (NOT result EQUAL 0) if (NOT result EQUAL 0)
string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}") string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}")