Fix T74504: Cycles wrong progress bar with CPU adaptive sampling
[blender.git] / tests / CMakeLists.txt
1
2 # Always run tests from install path, so all required scripts and libraries
3 # are available and we are testing the actual installation layout.
4 #
5 # Getting the install path of the executable is somewhat involved, as there are
6 # no direct CMake generator expressions to get the install paths of executables.
7 get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
8 if(GENERATOR_IS_MULTI_CONFIG)
9   string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
10 else()
11   string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
12 endif()
13
14 # Path to Blender and Python executables for all platforms.
15 if(MSVC)
16   set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender.exe)
17   set(TEST_PYTHON_EXE "${TEST_INSTALL_DIR}/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>")
18 elseif(APPLE)
19   set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/Blender.app/Contents/MacOS/Blender)
20   set(TEST_PYTHON_EXE)
21 else()
22   set(TEST_BLENDER_EXE ${TEST_INSTALL_DIR}/blender)
23   set(TEST_PYTHON_EXE)
24 endif()
25
26 # For testing with Valgrind
27 # set(TEST_BLENDER_EXE valgrind --track-origins=yes --error-limit=no ${TEST_BLENDER_EXE})
28
29 # Standard Blender arguments for running tests.
30 set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup)
31
32 # Python CTests
33 if(WITH_BLENDER AND WITH_PYTHON)
34   add_subdirectory(python)
35 endif()
36
37 # GTest
38 add_subdirectory(gtests)