Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-01-11 13:29:30 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-01-11 13:29:30 +0300
commit54f8a5dd737388d89332f3074eba01edc9efa8c1 (patch)
tree5ed34e5235a250625130aeab7bdc4cbc5647071c /build_files/cmake/Modules/GTestTesting.cmake
parent63cea2b793d0dd98b69cab156ba3be4dcf9f234a (diff)
Tests: run suites instead of individual test cases
Group all tests of a test suite into a single test command invocation. This reduces the number of invocations by `ctest` by an order of magnitude. Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every individual test. Having over a 1000 tests made testing slower than necessary. Individual tests can still be run if desired by invocation of `bin/tests/blender_test --gtest_filter=suitename.testname`. NOTE: For this commit to have an immediate effect, it may be necessary to remove the `tests` and `Testing` directories and some CMake files from your build directory and rebuild. Run `ctest -N` to see the list of tests; there should be less than 200. Reviewed By: sergey, LazyDodo, sebbas Maniphest Tasks: T83222 Differential Revision: https://developer.blender.org/D9649
Diffstat (limited to 'build_files/cmake/Modules/GTestTesting.cmake')
-rw-r--r--build_files/cmake/Modules/GTestTesting.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake
index 6406dd6aa28..70f48fc33ea 100644
--- a/build_files/cmake/Modules/GTestTesting.cmake
+++ b/build_files/cmake/Modules/GTestTesting.cmake
@@ -8,6 +8,17 @@
#
#=============================================================================
+function(GET_BLENDER_TEST_INSTALL_DIR VARIABLE_NAME)
+ get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(GENERATOR_IS_MULTI_CONFIG)
+ string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
+ else()
+ string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
+ endif()
+ set(${VARIABLE_NAME} "${TEST_INSTALL_DIR}" PARENT_SCOPE)
+endfunction()
+
+
macro(BLENDER_SRC_GTEST_EX)
if(WITH_GTESTS)
set(options SKIP_ADD_TEST)
@@ -75,13 +86,7 @@ macro(BLENDER_SRC_GTEST_EX)
target_link_libraries(${TARGET_NAME} ${GMP_LIBRARIES})
endif()
- get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
- if(GENERATOR_IS_MULTI_CONFIG)
- string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
- else()
- string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
- endif()
-
+ GET_BLENDER_TEST_INSTALL_DIR(TEST_INSTALL_DIR)
set_target_properties(${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"