Fix T53638: View layer renaming crashes 2/2
[blender.git] / tests / python / view_layer / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # Contributor(s): Jacques Beaurain, Dalai Felinto.
18 #
19 # ***** END GPL LICENSE BLOCK *****
20
21 # --env-system-scripts allows to run without the install target. 
22
23 # Use '--write-blend=/tmp/test.blend' to view output
24
25 set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/../lib/tests)
26 set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
27
28 # ugh, any better way to do this on testing only?
29 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
30
31 #~      if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
32 #~              message(FATAL_ERROR "CMake test directory not found!")
33 #~      endif()
34
35 # all calls to blender use this
36 if(APPLE)
37         if(${CMAKE_GENERATOR} MATCHES "Xcode")
38                 set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/Debug/blender.app/Contents/MacOS/blender)
39         else()
40                 set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender.app/Contents/MacOS/blender)
41         endif()
42 else()
43         set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender)
44 endif()
45
46 # for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no 
47 set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
48
49
50 # ------------------------------------------------------------------------------
51
52 macro(VIEW_LAYER_TEST test_name)
53         # Adds ${CMAKE_CURRENT_LIST_DIR} to sys.path so that the tests can import
54         # things from view_layer_common.py
55         add_test(view_layer_${test_name} ${TEST_BLENDER_EXE}
56                 --python-expr "import sys; sys.path.append('${CMAKE_CURRENT_LIST_DIR}')"
57                 --python-exit-code 1
58                 --python ${CMAKE_CURRENT_LIST_DIR}/test_${test_name}.py --
59                 --testdir="${TEST_SRC_DIR}/layers"
60         )
61 endmacro()
62
63 VIEW_LAYER_TEST(active_collection)
64 VIEW_LAYER_TEST(background_set)
65 VIEW_LAYER_TEST(collection_rename)
66 VIEW_LAYER_TEST(evaluation_render_settings_a)
67 VIEW_LAYER_TEST(evaluation_render_settings_b)
68 VIEW_LAYER_TEST(evaluation_render_settings_c)
69 VIEW_LAYER_TEST(evaluation_render_settings_d)
70 VIEW_LAYER_TEST(evaluation_render_settings_e)
71 VIEW_LAYER_TEST(evaluation_render_settings_f)
72 VIEW_LAYER_TEST(evaluation_render_settings_g)
73 VIEW_LAYER_TEST(evaluation_render_settings_h)
74 VIEW_LAYER_TEST(evaluation_render_settings_i)
75 VIEW_LAYER_TEST(evaluation_visibility_a)
76 VIEW_LAYER_TEST(evaluation_visibility_b)
77 VIEW_LAYER_TEST(evaluation_visibility_c)
78 VIEW_LAYER_TEST(evaluation_visibility_d)
79 VIEW_LAYER_TEST(evaluation_visibility_e)
80 VIEW_LAYER_TEST(evaluation_visibility_f)
81 VIEW_LAYER_TEST(evaluation_visibility_g)
82 VIEW_LAYER_TEST(evaluation_visibility_h)
83 VIEW_LAYER_TEST(evaluation_visibility_i)
84 VIEW_LAYER_TEST(evaluation_selectability_a)
85 VIEW_LAYER_TEST(evaluation_selectability_b)
86 VIEW_LAYER_TEST(evaluation_selectability_c)
87 VIEW_LAYER_TEST(evaluation_selectability_d)
88 VIEW_LAYER_TEST(evaluation_selectability_e)
89 VIEW_LAYER_TEST(evaluation_selectability_f)
90 VIEW_LAYER_TEST(group_a)
91 VIEW_LAYER_TEST(group_b)
92 VIEW_LAYER_TEST(group_c)
93 VIEW_LAYER_TEST(group_d)
94 VIEW_LAYER_TEST(object_add_cylinder)
95 VIEW_LAYER_TEST(object_add_empty)
96 VIEW_LAYER_TEST(object_add_torus)
97 VIEW_LAYER_TEST(object_add_no_collection_cylinder)
98 VIEW_LAYER_TEST(object_add_no_collection_empty)
99 VIEW_LAYER_TEST(object_add_no_collection_torus)
100 VIEW_LAYER_TEST(object_copy)
101 VIEW_LAYER_TEST(object_delete_a)
102 VIEW_LAYER_TEST(object_delete_b)
103 VIEW_LAYER_TEST(object_link_a)
104 VIEW_LAYER_TEST(object_link_b)
105 VIEW_LAYER_TEST(object_link_c)
106 VIEW_LAYER_TEST(operator_context)
107 VIEW_LAYER_TEST(move_above_below_scene_collection_a)
108 VIEW_LAYER_TEST(move_above_below_scene_collection_b)
109 VIEW_LAYER_TEST(move_above_below_scene_collection_c)
110 VIEW_LAYER_TEST(move_above_below_scene_collection_d)
111 VIEW_LAYER_TEST(move_above_below_scene_collection_e)
112 VIEW_LAYER_TEST(move_above_below_scene_collection_f)
113 VIEW_LAYER_TEST(move_above_below_scene_collection_g)
114 VIEW_LAYER_TEST(move_above_below_scene_collection_h)
115 VIEW_LAYER_TEST(move_above_below_scene_collection_i)
116 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_a)
117 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_b)
118 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_c)
119 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_d)
120 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_e)
121 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_f)
122 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_g)
123 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_h)
124 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_i)
125 VIEW_LAYER_TEST(move_into_scene_collection_a)
126 VIEW_LAYER_TEST(move_into_scene_collection_b)
127 VIEW_LAYER_TEST(move_into_scene_collection_c)
128 VIEW_LAYER_TEST(move_into_scene_collection_d)
129 VIEW_LAYER_TEST(move_into_scene_collection_e)
130 VIEW_LAYER_TEST(move_into_scene_collection_f)
131 VIEW_LAYER_TEST(move_into_scene_collection_g)
132 VIEW_LAYER_TEST(move_into_scene_collection_h)
133 VIEW_LAYER_TEST(move_into_scene_collection_i)
134 VIEW_LAYER_TEST(move_into_scene_collection_j)
135 VIEW_LAYER_TEST(move_into_scene_collection_k)
136 VIEW_LAYER_TEST(move_into_scene_collection_l)
137 VIEW_LAYER_TEST(move_into_scene_collection_sync_a)
138 VIEW_LAYER_TEST(move_into_scene_collection_sync_b)
139 VIEW_LAYER_TEST(move_into_scene_collection_sync_c)
140 VIEW_LAYER_TEST(move_into_scene_collection_sync_d)
141 VIEW_LAYER_TEST(move_into_scene_collection_sync_e)
142 VIEW_LAYER_TEST(move_into_scene_collection_sync_f)
143 VIEW_LAYER_TEST(move_into_scene_collection_sync_g)
144 VIEW_LAYER_TEST(move_into_scene_collection_sync_h)
145 VIEW_LAYER_TEST(move_into_scene_collection_sync_i)
146 VIEW_LAYER_TEST(move_into_scene_collection_sync_j)
147 VIEW_LAYER_TEST(move_into_scene_collection_sync_k)
148 VIEW_LAYER_TEST(move_into_scene_collection_sync_l)
149 VIEW_LAYER_TEST(move_above_below_layer_collection_a)
150 VIEW_LAYER_TEST(move_above_below_layer_collection_b)
151 VIEW_LAYER_TEST(move_above_below_layer_collection_c)
152 VIEW_LAYER_TEST(move_above_below_layer_collection_d)
153 VIEW_LAYER_TEST(move_above_below_layer_collection_e)
154 VIEW_LAYER_TEST(move_above_below_layer_collection_f)
155 VIEW_LAYER_TEST(move_above_below_layer_collection_g)
156 VIEW_LAYER_TEST(move_above_below_layer_collection_h)
157 VIEW_LAYER_TEST(move_above_below_layer_collection_i)
158 VIEW_LAYER_TEST(move_above_below_layer_collection_j)
159 VIEW_LAYER_TEST(move_above_below_layer_collection_k)
160 VIEW_LAYER_TEST(move_above_below_layer_collection_l)
161 VIEW_LAYER_TEST(move_into_layer_collection_a)
162 VIEW_LAYER_TEST(move_into_layer_collection_b)
163 VIEW_LAYER_TEST(move_into_layer_collection_c)
164 VIEW_LAYER_TEST(move_into_layer_collection_d)
165 VIEW_LAYER_TEST(move_into_layer_collection_e)
166 VIEW_LAYER_TEST(move_into_layer_collection_f)
167 VIEW_LAYER_TEST(move_into_layer_collection_g)
168 VIEW_LAYER_TEST(move_into_layer_collection_h)
169 VIEW_LAYER_TEST(move_into_layer_collection_i)
170 VIEW_LAYER_TEST(move_into_layer_collection_j)
171 VIEW_LAYER_TEST(layer_linking)
172 VIEW_LAYER_TEST(layer_syncing)
173 VIEW_LAYER_TEST(scene_copy_a)
174 VIEW_LAYER_TEST(scene_copy_b)
175 VIEW_LAYER_TEST(scene_copy_c)
176 VIEW_LAYER_TEST(scene_copy_d)
177 VIEW_LAYER_TEST(scene_copy_e)
178 VIEW_LAYER_TEST(scene_copy_f)
179 VIEW_LAYER_TEST(scene_delete)
180 VIEW_LAYER_TEST(scene_write_read)
181 VIEW_LAYER_TEST(view_layer_rename)