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:
Diffstat (limited to 'tests/python/CMakeLists.txt')
-rw-r--r--tests/python/CMakeLists.txt100
1 files changed, 58 insertions, 42 deletions
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 79031824b83..f973488d657 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -513,32 +513,36 @@ add_test(
)
endif()
+# Run Python script outside Blender.
+function(add_python_test testname testscript)
+ if(MSVC)
+ add_test(
+ NAME ${testname}
+ COMMAND
+ "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
+ ${testscript} ${ARGN}
+ )
+ else()
+ add_test(
+ NAME ${testname}
+ COMMAND ${testscript} ${ARGN}
+ )
+ endif()
+endfunction()
+
if(WITH_CYCLES)
if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/cycles/ctests/shader")
macro(add_cycles_render_test subject)
- if(MSVC)
- add_test(
- NAME cycles_${subject}_test
- COMMAND
- "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
- ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
- -blender "$<TARGET_FILE:blender>"
- -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
- -idiff "${OPENIMAGEIO_IDIFF}"
- -outdir "${TEST_OUT_DIR}/cycles"
- )
- else()
- add_test(
- NAME cycles_${subject}_test
- COMMAND ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
- -blender "$<TARGET_FILE:blender>"
- -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
- -idiff "${OPENIMAGEIO_IDIFF}"
- -outdir "${TEST_OUT_DIR}/cycles"
- )
- endif()
+ add_python_test(
+ cycles_${subject}_test
+ ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
+ -blender "$<TARGET_FILE:blender>"
+ -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
+ -idiff "${OPENIMAGEIO_IDIFF}"
+ -outdir "${TEST_OUT_DIR}/cycles"
+ )
endmacro()
- if(WITH_OPENGL_TESTS)
+ if(WITH_OPENGL_RENDER_TESTS)
add_cycles_render_test(opengl)
endif()
add_cycles_render_test(bake)
@@ -562,6 +566,31 @@ if(WITH_CYCLES)
endif()
endif()
+if(WITH_OPENGL_DRAW_TESTS)
+ if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/opengl")
+ # Use all test folders
+ file(GLOB children RELATIVE ${TEST_SRC_DIR} ${TEST_SRC_DIR}/*)
+ foreach(child ${children})
+ if(IS_DIRECTORY ${TEST_SRC_DIR}/${child})
+ file(GLOB blends ${TEST_SRC_DIR}/${child}/*.blend)
+ if(blends)
+ add_python_test(
+ opengl_draw_${child}_test
+ ${CMAKE_CURRENT_LIST_DIR}/opengl_draw_tests.py
+ -blender "$<TARGET_FILE:blender>"
+ -testdir "${TEST_SRC_DIR}/${child}"
+ -idiff "${OPENIMAGEIO_IDIFF}"
+ -outdir "${TEST_OUT_DIR}/opengl_draw"
+ )
+ endif()
+ endif()
+ endforeach()
+ else()
+ MESSAGE(STATUS "Disabling OpenGL tests because tests folder does not exist")
+ endif()
+endif()
+
+
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)
if(NOT ALEMBIC_FOUND)
@@ -570,26 +599,13 @@ if(WITH_ALEMBIC)
get_filename_component(real_include_dir ${ALEMBIC_INCLUDE_DIR} REALPATH)
get_filename_component(ALEMBIC_ROOT_DIR ${real_include_dir} DIRECTORY)
- if(MSVC)
- # FIXME, de-duplicate.
- add_test(
- NAME alembic_tests
- COMMAND
- "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
- ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
- --blender "$<TARGET_FILE:blender>"
- --testdir "${TEST_SRC_DIR}/alembic"
- --alembic-root "${ALEMBIC_ROOT_DIR}"
- )
- else()
- add_test(
- NAME alembic_tests
- COMMAND ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
- --blender "$<TARGET_FILE:blender>"
- --testdir "${TEST_SRC_DIR}/alembic"
- --alembic-root "${ALEMBIC_ROOT_DIR}"
- )
- endif()
+ add_python_test(
+ alembic_tests
+ ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
+ --blender "$<TARGET_FILE:blender>"
+ --testdir "${TEST_SRC_DIR}/alembic"
+ --alembic-root "${ALEMBIC_ROOT_DIR}"
+ )
add_test(
NAME script_alembic_import