Merge branch 'master' into blender2.8
[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_new_sync)
66 VIEW_LAYER_TEST(collection_rename_a)
67 VIEW_LAYER_TEST(collection_rename_b)
68 #VIEW_LAYER_TEST(evaluation_render_settings_a)
69 #VIEW_LAYER_TEST(evaluation_render_settings_b)
70 #VIEW_LAYER_TEST(evaluation_render_settings_c)
71 #VIEW_LAYER_TEST(evaluation_render_settings_d)
72 #VIEW_LAYER_TEST(evaluation_render_settings_e)
73 #VIEW_LAYER_TEST(evaluation_render_settings_f)
74 #VIEW_LAYER_TEST(evaluation_render_settings_g)
75 #VIEW_LAYER_TEST(evaluation_render_settings_h)
76 #VIEW_LAYER_TEST(evaluation_render_settings_i)
77 VIEW_LAYER_TEST(evaluation_visibility_a)
78 VIEW_LAYER_TEST(evaluation_visibility_b)
79 VIEW_LAYER_TEST(evaluation_visibility_c)
80 VIEW_LAYER_TEST(evaluation_visibility_d)
81 VIEW_LAYER_TEST(evaluation_visibility_e)
82 VIEW_LAYER_TEST(evaluation_visibility_f)
83 VIEW_LAYER_TEST(evaluation_visibility_g)
84 VIEW_LAYER_TEST(evaluation_visibility_h)
85 VIEW_LAYER_TEST(evaluation_visibility_i)
86 VIEW_LAYER_TEST(evaluation_visibility_j)
87 VIEW_LAYER_TEST(evaluation_selectability_a)
88 VIEW_LAYER_TEST(evaluation_selectability_b)
89 VIEW_LAYER_TEST(evaluation_selectability_c)
90 VIEW_LAYER_TEST(evaluation_selectability_d)
91 VIEW_LAYER_TEST(evaluation_selectability_e)
92 VIEW_LAYER_TEST(evaluation_selectability_f)
93 VIEW_LAYER_TEST(group_a)
94 VIEW_LAYER_TEST(group_b)
95 VIEW_LAYER_TEST(group_c)
96 VIEW_LAYER_TEST(group_d)
97 VIEW_LAYER_TEST(group_e)
98 VIEW_LAYER_TEST(object_add_cylinder)
99 VIEW_LAYER_TEST(object_add_empty)
100 VIEW_LAYER_TEST(object_add_torus)
101 VIEW_LAYER_TEST(object_add_no_collection_cylinder)
102 VIEW_LAYER_TEST(object_add_no_collection_empty)
103 VIEW_LAYER_TEST(object_add_no_collection_torus)
104 VIEW_LAYER_TEST(object_copy)
105 VIEW_LAYER_TEST(object_delete_a)
106 VIEW_LAYER_TEST(object_delete_b)
107 VIEW_LAYER_TEST(object_link_a)
108 VIEW_LAYER_TEST(object_link_b)
109 VIEW_LAYER_TEST(object_link_c)
110 VIEW_LAYER_TEST(operator_context)
111 VIEW_LAYER_TEST(make_single_user)
112 VIEW_LAYER_TEST(move_above_below_scene_collection_a)
113 VIEW_LAYER_TEST(move_above_below_scene_collection_b)
114 VIEW_LAYER_TEST(move_above_below_scene_collection_c)
115 VIEW_LAYER_TEST(move_above_below_scene_collection_d)
116 VIEW_LAYER_TEST(move_above_below_scene_collection_e)
117 VIEW_LAYER_TEST(move_above_below_scene_collection_f)
118 VIEW_LAYER_TEST(move_above_below_scene_collection_g)
119 VIEW_LAYER_TEST(move_above_below_scene_collection_h)
120 VIEW_LAYER_TEST(move_above_below_scene_collection_i)
121 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_a)
122 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_b)
123 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_c)
124 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_d)
125 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_e)
126 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_f)
127 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_g)
128 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_h)
129 VIEW_LAYER_TEST(move_above_below_scene_collection_sync_i)
130 VIEW_LAYER_TEST(move_into_scene_collection_a)
131 VIEW_LAYER_TEST(move_into_scene_collection_b)
132 VIEW_LAYER_TEST(move_into_scene_collection_c)
133 VIEW_LAYER_TEST(move_into_scene_collection_d)
134 VIEW_LAYER_TEST(move_into_scene_collection_e)
135 VIEW_LAYER_TEST(move_into_scene_collection_f)
136 VIEW_LAYER_TEST(move_into_scene_collection_g)
137 VIEW_LAYER_TEST(move_into_scene_collection_h)
138 VIEW_LAYER_TEST(move_into_scene_collection_i)
139 VIEW_LAYER_TEST(move_into_scene_collection_j)
140 VIEW_LAYER_TEST(move_into_scene_collection_k)
141 VIEW_LAYER_TEST(move_into_scene_collection_l)
142 VIEW_LAYER_TEST(move_into_scene_collection_sync_a)
143 VIEW_LAYER_TEST(move_into_scene_collection_sync_b)
144 VIEW_LAYER_TEST(move_into_scene_collection_sync_c)
145 VIEW_LAYER_TEST(move_into_scene_collection_sync_d)
146 VIEW_LAYER_TEST(move_into_scene_collection_sync_e)
147 VIEW_LAYER_TEST(move_into_scene_collection_sync_f)
148 VIEW_LAYER_TEST(move_into_scene_collection_sync_g)
149 VIEW_LAYER_TEST(move_into_scene_collection_sync_h)
150 VIEW_LAYER_TEST(move_into_scene_collection_sync_i)
151 VIEW_LAYER_TEST(move_into_scene_collection_sync_j)
152 VIEW_LAYER_TEST(move_into_scene_collection_sync_k)
153 VIEW_LAYER_TEST(move_into_scene_collection_sync_l)
154 VIEW_LAYER_TEST(move_above_below_layer_collection_a)
155 VIEW_LAYER_TEST(move_above_below_layer_collection_b)
156 VIEW_LAYER_TEST(move_above_below_layer_collection_c)
157 VIEW_LAYER_TEST(move_above_below_layer_collection_d)
158 VIEW_LAYER_TEST(move_above_below_layer_collection_e)
159 VIEW_LAYER_TEST(move_above_below_layer_collection_f)
160 VIEW_LAYER_TEST(move_above_below_layer_collection_g)
161 VIEW_LAYER_TEST(move_above_below_layer_collection_h)
162 VIEW_LAYER_TEST(move_above_below_layer_collection_i)
163 VIEW_LAYER_TEST(move_above_below_layer_collection_j)
164 VIEW_LAYER_TEST(move_above_below_layer_collection_k)
165 VIEW_LAYER_TEST(move_above_below_layer_collection_l)
166 VIEW_LAYER_TEST(move_into_layer_collection_a)
167 VIEW_LAYER_TEST(move_into_layer_collection_b)
168 VIEW_LAYER_TEST(move_into_layer_collection_c)
169 VIEW_LAYER_TEST(move_into_layer_collection_d)
170 VIEW_LAYER_TEST(move_into_layer_collection_e)
171 VIEW_LAYER_TEST(move_into_layer_collection_f)
172 VIEW_LAYER_TEST(move_into_layer_collection_g)
173 VIEW_LAYER_TEST(move_into_layer_collection_h)
174 VIEW_LAYER_TEST(move_into_layer_collection_i)
175 VIEW_LAYER_TEST(move_into_layer_collection_j)
176 VIEW_LAYER_TEST(layer_linking)
177 VIEW_LAYER_TEST(layer_syncing)
178 VIEW_LAYER_TEST(scene_collection_delete)
179 VIEW_LAYER_TEST(scene_copy_a)
180 VIEW_LAYER_TEST(scene_copy_b)
181 VIEW_LAYER_TEST(scene_copy_c)
182 VIEW_LAYER_TEST(scene_copy_d)
183 VIEW_LAYER_TEST(scene_copy_e)
184 VIEW_LAYER_TEST(scene_copy_f)
185 VIEW_LAYER_TEST(scene_delete)
186 VIEW_LAYER_TEST(scene_objects)
187 VIEW_LAYER_TEST(scene_write_read)
188 VIEW_LAYER_TEST(view_layer_rename)