Blender Git Loki

Git Commits -> Revision 56aa5b0

Revision 56aa5b0 by Sybren A. Stüvel (master)
July 16, 2020, 10:58 (GMT)
T73268: Link C/C++ unit tests into single executable

This commit introduces a new way to build unit tests. It is now possible
for each module to generate its own test library. The tests in these
libraries are then bundled into a single executable.

The test executable can be run with `ctest`. Even though the tests
reside in a single executable, they are still exposed as individual
tests to `ctest`, and thus can be selected via its `-R` argument.

Not yet ported tests still build & run as before.

The following rules apply:

- Test code should reside in the same directory as the code under test.
- Tests that target functionality in `somefile.{c,cc}` should reside in
`somefile_test.cc`.
- The namespace for tests is the `tests` sub-namespace of the code under
test. For example, tests for `blender::bke` should be in
`blender::bke:tests`.
- The test files should be listed in the module's `CMakeLists.txt` in a
`blender_add_test_lib()` call. See the `blenkernel` module for an
example.

Reviewed By: brecht

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

Commit Details:

Full Hash: 56aa5b0d8c6b66369f979e8bee4f1bd99454a99f
Parent Commit: 065a00e
Lines Changed: +460, -357

4 Added Paths:

/source/blender/blenkernel/intern/armature_test.cc (+93, -0) (View)
/source/blender/blenkernel/intern/fcurve_test.cc (+215, -0) (View)
/tests/gtests/runner/blender_test.cc (+25, -0) (View)
/tests/gtests/runner/CMakeLists.txt (+63, -0) (View)

3 Deleted Paths:

/tests/gtests/blenkernel/BKE_armature_test.cc (+0, -89)
/tests/gtests/blenkernel/BKE_fcurve_test.cc (+0, -211)
/tests/gtests/blenkernel/CMakeLists.txt (+0, -44)

7 Modified Paths:

/build_files/cmake/macros.cmake (+36, -0) (Diff)
/build_files/cmake/Modules/GTestTesting.cmake (+5, -0) (Diff)
/CMakeLists.txt (+0, -4) (Diff)
/intern/libmv/CMakeLists.txt (+2, -0) (Diff)
/source/blender/blenkernel/CMakeLists.txt (+13, -0) (Diff)
/tests/gtests/CMakeLists.txt (+4, -9) (Diff)
/tests/gtests/testing/CMakeLists.txt (+4, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021