Tools/Tests/GTest

= C/C++ Tests =

GoogleTest is the C++ testing framework used to test C/C++ code in Blender.

Building of tests must be enabled using the `WITH_GTESTS` CMake build option, tests can then be run with `make test`.

Test Executables
Unit tests are bundled in one executable per module, for example `blenlib_test`. Integration tests that depend on other Blender modules are built as part of the `blender_test` executable.

The tests executables are output to `bin/tests/` in the build directory.

Test Source Files
Test code is located in `tests/` folders in modules, next to the source files for the module.

Details are described in the Tests section of the C++ style guide.

Example
The tests for Blender's path utilities: `blenlib/intern/path_util.c`

Test file located in: `blenlib/tests/BLI_path_util_test.cc`

The test can be executed from the build directory: `./bin/tests/blenlib_test`

And produces output, for example: