Blender Git Loki

Git Commits -> Revision 4e9807a

November 15, 2019, 14:14 (GMT)
Blendfile-loading test class

To test some functionality of the USD exporter, I want to be able to load a blend file and run parts of the exporter. Up to now this wasn't possible from a GTest test. Of course a Python test could run the USD exporter, but testing the result would require writing a parser for USD files, which I want to avoid.

This new test class minimally sets up Blender so that it can load blend files and construct a depsgraph without crashing. Note that I haven't tested this on very complex blend files, so it may still crash when the loaded blend file references/requires uninitialised data structures.

The test will certainly crash with Blend files created with Blender 2.80, as the versioning code requires space types to be registered. This is normally done by initialising the window manager, which is not done in this test. The WM requires Python to run, which in turn requires that Blender finds the release directory in the same directory that contains the running executable, which is not the case for GTest tests (they are written to `bin/tests/executablename`.

This patch requires the functionality from {D6236}.

Differential Revision: https://developer.blender.org/D6246

Commit Details:

Full Hash: 4e9807a3bd23cc75db7894f279466727d5a103a6
Parent Commit: 7dfa2c2
Lines Changed: +253, -0

4 Added Paths:

/tests/gtests/blenloader/blendfile_load_test.cc (+14, -0) (View)
/tests/gtests/blenloader/CMakeLists.txt (+58, -0) (View)
/tests/gtests/testing/blendfile_loading_test.cc (+122, -0) (View)
/tests/gtests/testing/blendfile_loading_test.h (+47, -0) (View)

2 Modified Paths:

/tests/gtests/CMakeLists.txt (+1, -0) (Diff)
/tests/gtests/testing/CMakeLists.txt (+11, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021