diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-07 23:48:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-07 23:51:19 +0300 |
commit | 4764362ebb9184eef03a3e7d77234ed973f9c43f (patch) | |
tree | 12ccd03c3a338d3991033726b620a6e52dec0350 /tests/CMakeLists.txt | |
parent | fd05f01be60128e70b7e53d566627c9e84b6a98d (diff) |
Fix GTests failing on Windows buildbot
Run these tests from the install directory so they can find dlls.
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 93bebaed4b2..7d8a1390628 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,33 @@ +# Always run tests from install path, so all required scripts and libraries +# are available and we are testing the actual installation layout. +# +# Getting the install path of the executable is somewhat involved, as there are +# no direct CMake generator expressions to get the install paths of executables. +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() + +# Path to Blender and Python executables for all platforms. +if(MSVC) + set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender.exe) + set(TEST_PYTHON_EXE "${TEST_INSTALL_DIR}/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>") +elseif(APPLE) + set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/Blender.app/Contents/MacOS/Blender) + set(TEST_PYTHON_EXE) +else() + set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender) + set(TEST_PYTHON_EXE) +endif() + +# For testing with Valgrind +# set(TEST_BLENDER_EXE valgrind --track-origins=yes --error-limit=no ${TEST_BLENDER_EXE}) + +# Standard Blender arguments for running tests. +set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup) + # Python CTests if(WITH_BLENDER AND WITH_PYTHON) add_subdirectory(python) |