Alembic unit tests: don't depend on ALEMBIC_ROOT_DIR being defined by user
[blender.git] / tests / python / 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.
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 # Some tests are interesting but take too long to run
26 # and don't give deterministic results
27 set(USE_EXPERIMENTAL_TESTS FALSE)
28
29 set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/../lib/tests)
30 set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
31
32 # ugh, any better way to do this on testing only?
33 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_OUT_DIR})
34
35 #~      if(NOT IS_DIRECTORY ${TEST_SRC_DIR})
36 #~              message(FATAL_ERROR "CMake test directory not found!")
37 #~      endif()
38
39 # all calls to blender use this
40 if(APPLE)
41         if(${CMAKE_GENERATOR} MATCHES "Xcode")
42                 set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/Debug/blender.app/Contents/MacOS/blender)
43         else()
44                 set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender.app/Contents/MacOS/blender)
45         endif()
46 else()
47         set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender)
48 endif()
49
50 # for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no 
51 set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE})
52 set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
53
54
55 # ------------------------------------------------------------------------------
56 # GENERAL PYTHON CORRECTNESS TESTS
57 add_test(script_load_keymap ${TEST_BLENDER_EXE}
58         --python ${CMAKE_CURRENT_LIST_DIR}/bl_keymap_completeness.py
59 )
60
61 add_test(script_load_addons ${TEST_BLENDER_EXE}
62         --python ${CMAKE_CURRENT_LIST_DIR}/bl_load_addons.py
63 )
64
65 add_test(script_load_modules ${TEST_BLENDER_EXE}
66         --python ${CMAKE_CURRENT_LIST_DIR}/bl_load_py_modules.py
67 )
68
69 # test running operators doesn't segfault under various conditions
70 if(USE_EXPERIMENTAL_TESTS)
71         add_test(script_run_operators ${TEST_BLENDER_EXE}
72                 --python ${CMAKE_CURRENT_LIST_DIR}/bl_run_operators.py
73         )
74 endif()
75
76 # ------------------------------------------------------------------------------
77 # PY API TESTS
78 add_test(script_pyapi_bpy_path ${TEST_BLENDER_EXE}
79         --python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_path.py
80 )
81
82 add_test(script_pyapi_bpy_utils_units ${TEST_BLENDER_EXE}
83         --python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_utils_units.py
84 )
85
86 add_test(script_pyapi_mathutils ${TEST_BLENDER_EXE}
87         --python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_mathutils.py
88 )
89
90 add_test(script_pyapi_idprop ${TEST_BLENDER_EXE}
91         --python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop.py
92 )
93
94 add_test(script_pyapi_idprop_datablock ${TEST_BLENDER_EXE}
95         --python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop_datablock.py
96 )
97
98 # ------------------------------------------------------------------------------
99 # MODELING TESTS
100 add_test(bevel ${TEST_BLENDER_EXE}
101         ${TEST_SRC_DIR}/modeling/bevel_regression.blend
102         --python-text run_tests
103 )
104
105 add_test(split_faces ${TEST_BLENDER_EXE}
106     ${TEST_SRC_DIR}/modeling/split_faces_test.blend
107     --python-text run_tests
108 )
109
110 # ------------------------------------------------------------------------------
111 # IO TESTS
112
113 # OBJ Import tests
114 # disabled until updated & working
115 if(FALSE)
116 add_test(import_obj_cube ${TEST_BLENDER_EXE}
117         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
118         --run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/cube.obj'\)
119         --md5=39cce4bacac2d1b18fc470380279bc15 --md5_method=SCENE
120         --write-blend=${TEST_OUT_DIR}/import_obj_cube.blend
121 )
122
123 add_test(import_obj_nurbs_cyclic ${TEST_BLENDER_EXE}
124         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
125         --run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/nurbs_cyclic.obj'\)
126         --md5=ad3c307e5883224a0492378cd32691ab --md5_method=SCENE
127         --write-blend=${TEST_OUT_DIR}/import_obj_nurbs_cyclic.blend
128 )
129
130 add_test(import_obj_makehuman ${TEST_BLENDER_EXE}
131         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
132         --run={'FINISHED'}&bpy.ops.import_scene.obj\(filepath='${TEST_SRC_DIR}/io_tests/obj/makehuman.obj'\)
133         --md5=c9f78b185e58358daa4ecaecfa75464e --md5_method=SCENE
134         --write-blend=${TEST_OUT_DIR}/import_obj_makehuman.blend
135 )
136 endif()
137
138 # OBJ Export tests
139 add_test(export_obj_cube ${TEST_BLENDER_EXE}
140         ${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
141         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
142         --run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_cube.obj',use_selection=False\)
143         --md5_source=${TEST_OUT_DIR}/export_obj_cube.obj
144         --md5_source=${TEST_OUT_DIR}/export_obj_cube.mtl
145         --md5=e80660437ad9bfe082849641c361a233 --md5_method=FILE
146 )
147
148 add_test(export_obj_nurbs ${TEST_BLENDER_EXE}
149         ${TEST_SRC_DIR}/io_tests/blend_geometry/nurbs.blend
150         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
151         --run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_nurbs.obj',use_selection=False,use_nurbs=True\)
152         --md5_source=${TEST_OUT_DIR}/export_obj_nurbs.obj
153         --md5_source=${TEST_OUT_DIR}/export_obj_nurbs.mtl
154         --md5=a733ae4fa4a591ea9b0912da3af042de --md5_method=FILE
155 )
156
157 # disabled until updated & working
158 if(FALSE)
159 add_test(export_obj_all_objects ${TEST_BLENDER_EXE}
160         ${TEST_SRC_DIR}/io_tests/blend_scene/all_objects.blend
161         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
162         --run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
163         --md5_source=${TEST_OUT_DIR}/export_obj_all_objects.obj
164         --md5_source=${TEST_OUT_DIR}/export_obj_all_objects.mtl
165         --md5=04b3ed97cede07a19548fc518ce9f8ca --md5_method=FILE
166 )
167 endif()
168
169
170
171 # PLY Import tests
172 add_test(import_ply_cube ${TEST_BLENDER_EXE}
173         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
174         --run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/cube_ascii.ply'\)
175         --md5=527134343c27fc0ea73115b85fbfd3ac --md5_method=SCENE
176         --write-blend=${TEST_OUT_DIR}/import_ply_cube.blend
177 )
178
179 add_test(import_ply_bunny ${TEST_BLENDER_EXE}
180         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
181         --run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/bunny2.ply'\)
182         --md5=6ea5b8533400a17accf928b8fd024eaa --md5_method=SCENE
183         --write-blend=${TEST_OUT_DIR}/import_ply_bunny.blend
184 )
185
186 add_test(import_ply_small_holes ${TEST_BLENDER_EXE}
187         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
188         --run={'FINISHED'}&bpy.ops.import_mesh.ply\(filepath='${TEST_SRC_DIR}/io_tests/ply/many_small_holes.ply'\)
189         --md5=c3093e26ecae5b6d59fbbcf2a0d0b39f --md5_method=SCENE
190         --write-blend=${TEST_OUT_DIR}/import_ply_small_holes.blend
191 )
192
193 # PLY Export
194 # disabled until updated & working
195 if(FALSE)
196 add_test(export_ply_cube_all_data ${TEST_BLENDER_EXE}
197         ${TEST_SRC_DIR}/io_tests/blend_geometry/cube_all_data.blend
198         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
199         --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_cube_all_data.ply'\)
200         --md5_source=${TEST_OUT_DIR}/export_ply_cube_all_data.ply
201         --md5=6adc3748ceae8298496f99d0e7e76c15 --md5_method=FILE
202 )
203
204 add_test(export_ply_suzanne_all_data ${TEST_BLENDER_EXE}
205         ${TEST_SRC_DIR}/io_tests/blend_geometry/suzanne_all_data.blend
206         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
207         --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_suzanne_all_data.ply'\)
208         --md5_source=${TEST_OUT_DIR}/export_ply_suzanne_all_data.ply
209         --md5=68ba23f02efd6511bfd093f45f703221 --md5_method=FILE
210 )
211 endif()
212
213 add_test(export_ply_vertices ${TEST_BLENDER_EXE}  # lame, add a better one
214         ${TEST_SRC_DIR}/io_tests/blend_geometry/vertices.blend
215         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
216         --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_vertices.ply'\)
217         --md5_source=${TEST_OUT_DIR}/export_ply_vertices.ply
218         --md5=37faba0aa2014451b27f951afa92f870 --md5_method=FILE
219 )
220
221
222 # STL Import tests
223 # disabled until updated & working
224 if(FALSE)
225 add_test(import_stl_cube ${TEST_BLENDER_EXE}
226         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
227         --run={'FINISHED'}&bpy.ops.import_mesh.stl\(filepath='${TEST_SRC_DIR}/io_tests/stl/cube.stl'\)
228         --md5=8ceb5bb7e1cb5f4342fa1669988c66b4 --md5_method=SCENE
229         --write-blend=${TEST_OUT_DIR}/import_stl_cube.blend
230 )
231
232 add_test(import_stl_conrod ${TEST_BLENDER_EXE}
233         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
234         --run={'FINISHED'}&bpy.ops.import_mesh.stl\(filepath='${TEST_SRC_DIR}/io_tests/stl/conrod.stl'\)
235         --md5=690a4b8eb9002dcd8631c5a575ea7348 --md5_method=SCENE
236         --write-blend=${TEST_OUT_DIR}/import_stl_conrod.blend
237 )
238
239 add_test(import_stl_knot_max_simplified ${TEST_BLENDER_EXE}
240         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
241         --run={'FINISHED'}&bpy.ops.import_mesh.stl\(filepath='${TEST_SRC_DIR}/io_tests/stl/knot_max_simplified.stl'\)
242         --md5=baf82803f45a84ec4ddbad9cef57dd3e --md5_method=SCENE
243         --write-blend=${TEST_OUT_DIR}/import_stl_knot_max_simplified.blend
244 )
245 endif()
246
247 # STL Export
248 # disabled until updated & working
249 if(FALSE)
250 add_test(export_stl_cube_all_data ${TEST_BLENDER_EXE}
251         ${TEST_SRC_DIR}/io_tests/blend_geometry/cube_all_data.blend
252         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
253         --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_cube_all_data.stl'\)
254         --md5_source=${TEST_OUT_DIR}/export_stl_cube_all_data.stl
255         --md5=64cb97c0cabb015e1c3f76369835075a --md5_method=FILE
256 )
257
258 add_test(export_stl_suzanne_all_data ${TEST_BLENDER_EXE}
259         ${TEST_SRC_DIR}/io_tests/blend_geometry/suzanne_all_data.blend
260         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
261         --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_suzanne_all_data.stl'\)
262         --md5_source=${TEST_OUT_DIR}/export_stl_suzanne_all_data.stl
263         --md5=e9b23c97c139ad64961c635105bb9192 --md5_method=FILE
264 )
265
266 add_test(export_stl_vertices ${TEST_BLENDER_EXE}  # lame, add a better one
267         ${TEST_SRC_DIR}/io_tests/blend_geometry/vertices.blend
268         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
269         --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_vertices.stl'\)
270         --md5_source=${TEST_OUT_DIR}/export_stl_vertices.stl
271         --md5=3fd3c877e573beeebc782532cc005820 --md5_method=FILE
272 )
273 endif()
274
275
276 # X3D Import
277 # disabled until updated & working
278 if(FALSE)
279 add_test(import_x3d_cube ${TEST_BLENDER_EXE}
280         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
281         --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/color_cube.x3d'\)
282         --md5=3fae9be004199c145941cd3f9f80ad7b --md5_method=SCENE
283         --write-blend=${TEST_OUT_DIR}/import_x3d_cube.blend
284 )
285
286 add_test(import_x3d_teapot ${TEST_BLENDER_EXE}
287         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
288         --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/teapot.x3d'\)
289         --md5=8ee196c71947dce4199d55698501691e --md5_method=SCENE
290         --write-blend=${TEST_OUT_DIR}/import_x3d_teapot.blend
291 )
292
293 add_test(import_x3d_suzanne_material ${TEST_BLENDER_EXE}
294         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
295         --run={'FINISHED'}&bpy.ops.import_scene.x3d\(filepath='${TEST_SRC_DIR}/io_tests/x3d/suzanne_material.x3d'\)
296         --md5=3edea1353257d8b5a5f071942f417be6 --md5_method=SCENE
297         --write-blend=${TEST_OUT_DIR}/import_x3d_suzanne_material.blend
298 )
299
300 # X3D Export
301 add_test(export_x3d_cube ${TEST_BLENDER_EXE}
302         ${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
303         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
304         --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\)
305         --md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d
306         --md5=05312d278fe41da33560fdfb9bdb268f --md5_method=FILE
307 )
308
309 add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
310         ${TEST_SRC_DIR}/io_tests/blend_geometry/nurbs.blend
311         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
312         --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\)
313         --md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d
314         --md5=4286d4a2aa507ef78b22ddcbdcc88481 --md5_method=FILE
315 )
316
317 add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
318         ${TEST_SRC_DIR}/io_tests/blend_scene/all_objects.blend
319         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
320         --run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
321         --md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
322         --md5=f5f9fa4c5619a0eeab66685aafd2f7f0 --md5_method=FILE
323 )
324 endif()
325
326
327
328 # 3DS Import
329 # disabled until updated & working
330 if(FALSE)
331 add_test(import_3ds_cube ${TEST_BLENDER_EXE}
332         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
333         --run={'FINISHED'}&bpy.ops.import_scene.autodesk_3ds\(filepath='${TEST_SRC_DIR}/io_tests/3ds/cube.3ds'\)
334         --md5=cb5a45c35a343c3f5beca2a918472951 --md5_method=SCENE
335         --write-blend=${TEST_OUT_DIR}/import_3ds_cube.blend
336 )
337
338 add_test(import_3ds_hierarchy_lara ${TEST_BLENDER_EXE}
339         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
340         --run={'FINISHED'}&bpy.ops.import_scene.autodesk_3ds\(filepath='${TEST_SRC_DIR}/io_tests/3ds/hierarchy_lara.3ds'\)
341         --md5=766c873d9fdb5f190e43796cfbae63b6 --md5_method=SCENE
342         --write-blend=${TEST_OUT_DIR}/import_3ds_hierarchy_lara.blend
343 )
344
345 add_test(import_3ds_hierarchy_greek_trireme ${TEST_BLENDER_EXE}
346         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
347         --run={'FINISHED'}&bpy.ops.import_scene.autodesk_3ds\(filepath='${TEST_SRC_DIR}/io_tests/3ds/hierarchy_greek_trireme.3ds'\)
348         --md5=b62ee30101e8999cb91ef4f8a8760056 --md5_method=SCENE
349         --write-blend=${TEST_OUT_DIR}/import_3ds_hierarchy_greek_trireme.blend
350 )
351 endif()
352
353 # 3DS Export
354 # disabled until updated & working
355 if(FALSE)
356 add_test(export_3ds_cube ${TEST_BLENDER_EXE}
357         ${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
358         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
359         --run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_cube.3ds',use_selection=False\)
360         --md5_source=${TEST_OUT_DIR}/export_3ds_cube.3ds
361         --md5=a31f5071b6c6dc7445b9099cdc7f63b3 --md5_method=FILE
362 )
363
364 add_test(export_3ds_nurbs ${TEST_BLENDER_EXE}
365         ${TEST_SRC_DIR}/io_tests/blend_geometry/nurbs.blend
366         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
367         --run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_nurbs.3ds',use_selection=False\)
368         --md5_source=${TEST_OUT_DIR}/export_3ds_nurbs.3ds
369         --md5=5bdd21be3c80d814fbc83cb25edb08c2 --md5_method=FILE
370 )
371
372 add_test(export_3ds_all_objects ${TEST_BLENDER_EXE}
373         ${TEST_SRC_DIR}/io_tests/blend_scene/all_objects.blend
374         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
375         --run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_all_objects.3ds',use_selection=False\)
376         --md5_source=${TEST_OUT_DIR}/export_3ds_all_objects.3ds
377         --md5=68447761ab0ca38e1e22e7c177ed48a8 --md5_method=FILE
378 )
379 endif()
380
381
382
383 # FBX Export
384 # 'use_metadata=False' for reliable md5's
385 # disabled until updated & working
386 if(FALSE)
387 add_test(export_fbx_cube ${TEST_BLENDER_EXE}
388         ${TEST_SRC_DIR}/io_tests/blend_geometry/all_quads.blend
389         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
390         --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_cube.fbx',use_selection=False,use_metadata=False\)
391         --md5_source=${TEST_OUT_DIR}/export_fbx_cube.fbx
392         --md5=59a35577462f95f9a0b4e6035226ce9b --md5_method=FILE
393 )
394
395 add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
396         ${TEST_SRC_DIR}/io_tests/blend_geometry/nurbs.blend
397         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
398         --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_nurbs.fbx',use_selection=False,use_metadata=False\)
399         --md5_source=${TEST_OUT_DIR}/export_fbx_nurbs.fbx
400         --md5=d31875f18f613fa0c3b16e978f87f6f8 --md5_method=FILE
401 )
402
403 add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
404         ${TEST_SRC_DIR}/io_tests/blend_scene/all_objects.blend
405         --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
406         --run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_all_objects.fbx',use_selection=False,use_metadata=False\)
407         --md5_source=${TEST_OUT_DIR}/export_fbx_all_objects.fbx
408         --md5=b35eb2a9d0e73762ecae2278c25a38ac --md5_method=FILE
409 )
410 endif()
411
412 if(WITH_CYCLES)
413         if(OPENIMAGEIO_IDIFF AND EXISTS "${TEST_SRC_DIR}/cycles/ctests/shader")
414                 macro(add_cycles_render_test subject)
415                         if(MSVC)
416                                 add_test(NAME cycles_${subject}_test
417                                         COMMAND
418                                                 "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
419                                                 ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
420                                         -blender "$<TARGET_FILE:blender>"
421                                         -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
422                                         -idiff "${OPENIMAGEIO_IDIFF}"
423                                 )
424                         else()
425                                 add_test(cycles_${subject}_test
426                                          ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
427                                         -blender "${TEST_BLENDER_EXE_BARE}"
428                                         -testdir "${TEST_SRC_DIR}/cycles/ctests/${subject}"
429                                         -idiff "${OPENIMAGEIO_IDIFF}"
430                                 )
431                         endif()
432                 endmacro()
433                 if(WITH_OPENGL_TESTS)
434                         add_cycles_render_test(opengl)
435                 endif()
436                 add_cycles_render_test(image)
437                 add_cycles_render_test(mblur)
438                 add_cycles_render_test(reports)
439                 add_cycles_render_test(render)
440                 add_cycles_render_test(shader)
441         else()
442                 MESSAGE(STATUS "Disabling Cycles tests because tests folder does not exist")
443         endif()
444 endif()
445
446 if(WITH_ALEMBIC)
447         find_package_wrapper(Alembic)
448         if(NOT ALEMBIC_FOUND)
449                 message(FATAL_ERROR "Alembic is enabled but cannot be found")
450         endif()
451         get_filename_component(real_include_dir ${ALEMBIC_INCLUDE_DIR} REALPATH)
452         get_filename_component(ALEMBIC_ROOT_DIR ${real_include_dir} DIRECTORY)
453
454         add_test(script_alembic_import ${TEST_BLENDER_EXE}
455                 --python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_import_test.py
456                 --
457                 --testdir "${TEST_SRC_DIR}/alembic"
458         )
459
460         if(MSVC)
461                 add_test(NAME cycles_${subject}_test
462                         COMMAND
463                                 "$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
464                                 ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
465                         --blender "${TEST_BLENDER_EXE_BARE}"
466                         --testdir "${TEST_SRC_DIR}/alembic"
467                         --alembic-root "${ALEMBIC_ROOT_DIR}"
468                 )
469         else()
470                 add_test(alembic_tests
471                         ${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
472                         --blender "${TEST_BLENDER_EXE_BARE}"
473                         --testdir "${TEST_SRC_DIR}/alembic"
474                         --alembic-root "${ALEMBIC_ROOT_DIR}"
475                 )
476         endif()
477 endif()