Fix GTests failing on Windows buildbot

Run these tests from the install directory so they can find dlls.
This commit is contained in:
Brecht Van Lommel
2019-09-07 22:48:21 +02:00
parent fd05f01be6
commit 4764362ebb
3 changed files with 30 additions and 29 deletions

View File

@@ -32,34 +32,6 @@ file(MAKE_DIRECTORY ${TEST_OUT_DIR}/io_tests)
#~ message(FATAL_ERROR "CMake test directory not found!")
#~ endif()
# Blender arguments for tests.
set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup)
# 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()
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})
# Run Blender command with parameters.
function(add_blender_test testname)
add_test(