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