diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 7 | ||||
-rw-r--r-- | Modules/FindOpenCL.cmake | 3 | ||||
-rw-r--r-- | Modules/GoogleTest.cmake | 14 | ||||
-rw-r--r-- | Modules/GoogleTestAddTests.cmake | 11 |
4 files changed, 28 insertions, 7 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 67aac4f..d284e27 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -714,8 +714,9 @@ control needed to implement such step-level capabilities. The command line, comment, working directory and byproducts of every standard and custom step are processed to replace the tokens ``<SOURCE_DIR>``, ``<SOURCE_SUBDIR>``, ``<BINARY_DIR>``, ``<INSTALL_DIR>`` - and ``<TMP_DIR>`` with their corresponding property values defined in the - original call to :command:`ExternalProject_Add`. + ``<TMP_DIR>``, ``<DOWNLOAD_DIR>`` and ``<DOWNLOADED_FILE>`` with their + corresponding property values defined in the original call to + :command:`ExternalProject_Add`. .. command:: ExternalProject_Add_StepTargets @@ -1665,7 +1666,7 @@ macro(_ep_replace_location_tags target_name) set(vars ${ARGN}) foreach(var ${vars}) if(${var}) - foreach(dir SOURCE_DIR SOURCE_SUBDIR BINARY_DIR INSTALL_DIR TMP_DIR DOWNLOADED_FILE) + foreach(dir SOURCE_DIR SOURCE_SUBDIR BINARY_DIR INSTALL_DIR TMP_DIR DOWNLOAD_DIR DOWNLOADED_FILE) get_property(val TARGET ${target_name} PROPERTY _EP_${dir}) string(REPLACE "<${dir}>" "${val}" ${var} "${${var}}") endforeach() diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake index 5d79110..297a5fb 100644 --- a/Modules/FindOpenCL.cmake +++ b/Modules/FindOpenCL.cmake @@ -76,6 +76,7 @@ find_path(OpenCL_INCLUDE_DIR ENV NVSDKCOMPUTE_ROOT ENV CUDA_PATH ENV ATISTREAMSDKROOT + ENV OCL_ROOT PATH_SUFFIXES include OpenCL/common/inc @@ -94,6 +95,7 @@ if(WIN32) ENV CUDA_PATH ENV NVSDKCOMPUTE_ROOT ENV ATISTREAMSDKROOT + ENV OCL_ROOT PATH_SUFFIXES "AMD APP/lib/x86" lib/x86 @@ -109,6 +111,7 @@ if(WIN32) ENV CUDA_PATH ENV NVSDKCOMPUTE_ROOT ENV ATISTREAMSDKROOT + ENV OCL_ROOT PATH_SUFFIXES "AMD APP/lib/x86_64" lib/x86_64 diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index 3d47367..c525101 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -217,6 +217,14 @@ same as the Google Test name (i.e. ``suite.testcase``); see also executable is being used in multiple calls to ``gtest_discover_tests()``. Note that this variable is only available in CTest. + ``TIMEOUT num`` + Specifies how long (in seconds) CMake will wait for the test to enumerate + available tests. If the test takes longer than this, discovery (and your + build) will fail. Most test executables will enumerate their tests very + quickly, but under some exceptional circumstances, a test may require a + longer timeout. The default is 5. See also the ``TIMEOUT`` option of + :command:`execute_process`. + #]=======================================================================] #------------------------------------------------------------------------------ @@ -349,7 +357,7 @@ function(gtest_discover_tests TARGET) cmake_parse_arguments( "" "NO_PRETTY_TYPES;NO_PRETTY_VALUES" - "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST" + "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;TIMEOUT" "EXTRA_ARGS;PROPERTIES" ${ARGN} ) @@ -360,6 +368,9 @@ function(gtest_discover_tests TARGET) if(NOT _TEST_LIST) set(_TEST_LIST ${TARGET}_TESTS) endif() + if(NOT _TIMEOUT) + set(_TIMEOUT 5) + endif() get_property( has_counter @@ -407,6 +418,7 @@ function(gtest_discover_tests TARGET) -D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}" -D "TEST_LIST=${_TEST_LIST}" -D "CTEST_FILE=${ctest_tests_file}" + -D "TEST_DISCOVERY_TIMEOUT=${_TIMEOUT}" -P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}" VERBATIM ) diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake index 7d0d909..5a4bdca 100644 --- a/Modules/GoogleTestAddTests.cmake +++ b/Modules/GoogleTestAddTests.cmake @@ -24,19 +24,24 @@ endfunction() # Run test executable to get list of available tests if(NOT EXISTS "${TEST_EXECUTABLE}") message(FATAL_ERROR - "Specified test executable '${TEST_EXECUTABLE}' does not exist" + "Specified test executable does not exist.\n" + " Path: '${TEST_EXECUTABLE}'" ) endif() execute_process( COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests + TIMEOUT ${TEST_DISCOVERY_TIMEOUT} OUTPUT_VARIABLE output RESULT_VARIABLE result ) if(NOT ${result} EQUAL 0) + string(REPLACE "\n" "\n " output "${output}") message(FATAL_ERROR - "Error running test executable '${TEST_EXECUTABLE}':\n" + "Error running test executable.\n" + " Path: '${TEST_EXECUTABLE}'\n" " Result: ${result}\n" - " Output: ${output}\n" + " Output:\n" + " ${output}\n" ) endif() |