Commit Graph

14 Commits

Author SHA1 Message Date
Campbell Barton dd25d47e8a Cleanup: add missing headers to CMake, formatting 2020-09-15 22:53:44 +10:00
Jacques Lucke 8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
Campbell Barton 0270941b70 Merge branch 'blender-v2.83-release' 2020-05-25 21:43:54 +10:00
Campbell Barton 7e9480b6cd Tests: correct the blender path for non-portable installations 2020-05-25 21:28:03 +10:00
Brecht Van Lommel 8da80e7771 Merge branch 'blender-v2.83-release' 2020-04-28 13:02:06 +02:00
Brecht Van Lommel 6cab53eaaa Tests: fix some tests passing even if there are Python errors
Blender was not configured to exit with non-zero return code on Python errors.
A bunch of tests worked around this but not all. This removes the need for such
workarounds.
2020-04-28 12:50:16 +02:00
Sybren A. Stüvel be5c9d45bd Tests: use explicit Python to run unit tests
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.

This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:

- On Windows, the `python….exe` from the installation directory. This is
  just like before this patch, except that this patch adds the
  overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.

Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.

If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.

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

Reviewed by: campbellbarton, mont29, sergey
2020-04-24 17:10:22 +02:00
Ray Molenkamp 6ac2a2061f Fix: Unit tests on windows.
Problem was twofold

1) `GENERATOR_IS_MULTI_CONFIG` is a property not a variable so
the test for it would always be false, unless you set a custom
CMAKE_INSTALL_PREFIX (like the buildbot does) the unit tests
would have a wrong working directory and complain about missing
dlls or blender executable

2) Tests added outside of `/test` (like libmv) would have no working
folder set since the variable would not be visible for them.

consulted @sergey who voiced the opinion that duplicating the code
to the test macro was slightly less evil than moving it to the main
CMakeLists.txt
2019-10-03 11:34:04 -06:00
Brecht Van Lommel 4764362ebb Fix GTests failing on Windows buildbot
Run these tests from the install directory so they can find dlls.
2019-09-07 22:51:19 +02:00
Campbell Barton 3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02:00
Campbell Barton b48815a9b7 Cleanup: use prefix for tests
Allows for running all `bmesh_*` or `object_*` tests.
2018-02-14 16:02:21 +11:00
Sergey Sharybin b53e35c655 Fix compilation error when building without Blender
Simply disabled python tests, they can't be run anyway (since blender target is
not enabled) and we don't have any player-related tests in that folder.
2017-08-08 11:32:33 +02:00
Sergey Sharybin 306cbb82ec GTest unit testing framework
Currently covers only small set of functionality.
2014-06-19 02:09:16 +10:00
Campbell Barton 0eb060c7b4 Move tests into tests/ top-level dir 2014-06-18 22:03:46 +10:00