Dev:Doc/Tools/Tests/Setup

提供: wiki
< Dev:Doc‎ | Tools‎ | Tests
移動先: 案内検索

Test Setup

Blender uses the CMake testing framework to build Python and GTest tests. Only a small fraction of Blender's code base is covered, developers are highly encouraged to add more tests.

This document assumes you have built blender using the official build instructions.

  • blender source in ~/blender-git/blender
  • blender build in ~/blender-git/build

Dependencies

External binary files are needed for running some Blender tests. They are available through a SVN repository. Run these commands to get them (assumes SVN being available):

cd ~/blender-git
mkdir lib
cd lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests

Running the tests

At least once you need to run the complete make command:

cd ~/blender-git/build
make test

This will run all the available tests. If you want to run a specific test, you can cancel make test as soon as it starts running tests. This step is further required to make newly added tests executable.

Running multiple tests with a similar name is possible using the -R option:

ctest -R render_layer

If a specific test fails, you can re-run it with verbose options to get more information:

ctest -R render_layer_evaluation_render_settings_a -VV

Regression Tests

Cycles and opengl drawing tests produce a HTML file to show the result of running regression tests, comparing renders and screenshots against a reference image. These can be found at:

  • ~/blender-git/build/tests/cycles/report.html
  • ~/blender-git/build/tests/opengl_draw/report.html

When there are benign test failures due to intentional changes, the reference images can be updated as follows:

BLENDER_TEST_UPDATE=1 ctest -R cycles