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
path: root/tests
diff options
context:
space:
mode:
authorlazydodo <github@lazydodo.com>2017-01-25 19:36:41 +0300
committerlazydodo <github@lazydodo.com>2017-01-25 19:37:19 +0300
commit64f5afdb89bbf3831e97d76a178acee1d9524452 (patch)
treef3e7731122698cb3a8fa2067cc60ffe6daa1599e /tests
parente5482f986cab62f77eec441df80fb622cbb5f177 (diff)
[Cycles/MSVC/Testing] Fix broken test code.
Currently the tests don't run on windows for the following reasons 1) render_graph_finalize has an linking issue due missing a bunch of libraries (not sure why this is not an issue for linux) 2) This one is more interesting, in test/python/cmakelists.txt ${TEST_BLENDER_EXE_BARE} and ${TEST_BLENDER_EXE} are flat out wrong, but for some reason this doesn't matter for most tests, cause ctest will actually go out and look for the executable and fix the path for you *BUT* only for the command, if you use them in any of the parameters it'll happily pass on the wrong path. 3) on linux you can just run a .py file, windows is not as awesome and needs to be told to run it with pyton. 4) had to use the NAME/COMMAND long form of add_test otherwise $<TARGET_FILE:blender> doesn't get expanded, why? beats me. 5) missing idiff.exe for msvc2015/x64 in the libs folder. This patch addresses 1-4 , but given I have no working Linux build environment, I'm unsure if it'll break anything there 5 has been fixed in rBL61751 Reviewers: juicyfruit, brecht, sergey Reviewed By: sergey Subscribers: Blendify Tags: #cycles, #automated_testing Differential Revision: https://developer.blender.org/D2367
Diffstat (limited to 'tests')
-rw-r--r--tests/gtests/CMakeLists.txt3
-rw-r--r--tests/gtests/blenlib/BLI_string_test.cc2
-rw-r--r--tests/gtests/testing/CMakeLists.txt3
-rw-r--r--tests/python/CMakeLists.txt40
4 files changed, 26 insertions, 22 deletions
diff --git a/tests/gtests/CMakeLists.txt b/tests/gtests/CMakeLists.txt
index a3860ce3e67..1d363f31119 100644
--- a/tests/gtests/CMakeLists.txt
+++ b/tests/gtests/CMakeLists.txt
@@ -4,6 +4,9 @@ if(WITH_GTESTS)
Include(GTestTesting)
+ add_definitions(${GFLAGS_DEFINES})
+ add_definitions(${GLOG_DEFINES})
+
# Otherwise we get warnings here that we cant fix in external projects
remove_strict_flags()
diff --git a/tests/gtests/blenlib/BLI_string_test.cc b/tests/gtests/blenlib/BLI_string_test.cc
index 17a4b5e82b9..08f2a745bdb 100644
--- a/tests/gtests/blenlib/BLI_string_test.cc
+++ b/tests/gtests/blenlib/BLI_string_test.cc
@@ -374,7 +374,7 @@ TEST(string, StrFormatIntGrouped)
const int word_num = BLI_string_find_split_words( \
word_str_src, word_str_src_len, ' ', word_info, word_cmp_size_input); \
EXPECT_EQ(word_num, word_cmp_size - 1); \
- EXPECT_EQ_ARRAY_ND(word_cmp, word_info, word_cmp_size, 2); \
+ EXPECT_EQ_ARRAY_ND<const int[2]>(word_cmp, word_info, word_cmp_size, 2); \
} ((void)0)
#define STRING_FIND_SPLIT_WORDS(word_str_src, ...) \
diff --git a/tests/gtests/testing/CMakeLists.txt b/tests/gtests/testing/CMakeLists.txt
index 1eb60e7f3b5..796f975ea65 100644
--- a/tests/gtests/testing/CMakeLists.txt
+++ b/tests/gtests/testing/CMakeLists.txt
@@ -47,7 +47,4 @@ set(SRC
testing.h
)
-add_definitions(${GFLAGS_DEFINES})
-add_definitions(${GLOG_DEFINES})
-
blender_add_lib(bf_testing_main "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index a29b612e0ef..4b5666e9b5a 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -399,24 +399,28 @@ endif()
if(WITH_CYCLES)
if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/cycles/ctests/shader")
- add_test(cycles_reports_test
- ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
- -blender "${TEST_BLENDER_EXE_BARE}"
- -testdir "${TEST_SRC_DIR}/cycles/ctests/reports"
- -idiff "${OPENIMAGEIO_IDIFF}"
- )
- add_test(cycles_render_test
- ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
- -blender "${TEST_BLENDER_EXE_BARE}"
- -testdir "${TEST_SRC_DIR}/cycles/ctests/render"
- -idiff "${OPENIMAGEIO_IDIFF}"
- )
- add_test(cycles_shaders_test
- ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
- -blender "${TEST_BLENDER_EXE_BARE}"
- -testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
- -idiff "${OPENIMAGEIO_IDIFF}"
- )
+ 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}"
+ )
+ else()
+ add_test(cycles_${subject}_test
+ ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
+ -blender "${TEST_BLENDER_EXE_BARE}"
+ -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
+ -idiff "${OPENIMAGEIO_IDIFF}"
+ )
+ endif()
+ endmacro()
+ add_cycles_render_test(reports)
+ add_cycles_render_test(render)
+ add_cycles_render_test(shader)
else()
MESSAGE(STATUS "Disabling Cycles tests because tests folder does not exist")
endif()