September 2018
Intermediate to advanced
606 pages
14h 32m
English
We need to inform CTest that tests need to be terminated if they go into overtime, as follows:
# set minimum cmake versioncmake_minimum_required(VERSION 3.5 FATAL_ERROR)# project nameproject(recipe-07 LANGUAGES NONE)# detect pythonfind_package(PythonInterp REQUIRED)# define testsenable_testing()# we expect this test to run for 2 secondsadd_test(example ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py)
set_tests_properties(example PROPERTIES TIMEOUT 10)
$ ctestTest project /home/user/cmake-recipes/chapter-04/recipe-07/example/build ...
Read now
Unlock full access