Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space usage, but is less convenient for running individual tests command line as filter flags need to be used. This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per source file. Note that enabling this option requires a significant amount of disk space. Due to refactoring, the resulting ctest names are a bit different than before. The number of tests is also a bit different depending if this option is used, as one uses gtests discovery and the other is organized purely by filename, which isn't always 1:1. Co-authored-by: Sergey Sharybin <sergey@blender.org> Pull Request: https://projects.blender.org/blender/blender/pulls/114604
This commit is contained in:
committed by
Brecht Van Lommel
parent
81017772f5
commit
364beee159
@@ -7,7 +7,9 @@ if(WITH_GTESTS)
|
||||
remove_strict_flags()
|
||||
|
||||
# Build common test executable used by most tests
|
||||
add_subdirectory(runner)
|
||||
if(WITH_TESTS_SINGLE_BINARY)
|
||||
add_subdirectory(runner)
|
||||
endif()
|
||||
|
||||
# Build utility library used by test executables
|
||||
add_subdirectory(testing)
|
||||
|
||||
@@ -32,7 +32,6 @@ blender_src_gtest_ex(
|
||||
NAME blender
|
||||
SRC "${SRC}"
|
||||
EXTRA_LIBS "${TEST_LIBS}"
|
||||
SKIP_ADD_TEST
|
||||
)
|
||||
setup_platform_linker_libs(blender_test)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user