Commit Graph

16 Commits

Author SHA1 Message Date
Ray Molenkamp
76cd021a5c Cleanup: CMake: Fix cmake warning regarding DEPENDS keyword
DEPENDS is not supported for post_build commands and recent
cmake versions have started emitting warnings about that.

This can be safely removed, as cmake has been silently ignoring
the keyword for years.
2025-03-16 16:09:18 -06:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Bastien Montagne
35f4cd0655 Fix (unreported) fully broken 'set custom envvars' feature for unittests.
A typo in `blender_test_set_envvars` cmake function made it impossible
for calling CMake code to specify custom environment variables.

Noticed that because trying to enable `WITH_UI_TESTS` option was
running my system Blender 4.0 instead of current build...

NOTE: This also revealed another issue (missing file in our Weston
library), will be fixed soon by Linux library maintainer.
2024-10-15 18:16:09 +02:00
Sergey Sharybin
c5e2e8ebc6 Build: Copy tests manifests instead of install
This avoids having INSTALL files with an absolute path that is
different from the "main" install path. In practice this should
solve the problem of WIX failing to package Blender 4.3.

Pull Request: https://projects.blender.org/blender/blender/pulls/128556
2024-10-04 09:57:41 +02:00
Anthony Roberts
b4c9986447 Windows: Enable external manifest by default on ARM64
This also fixes tests not having external manifests when the option is enabled, and properly detects clang-cl in the libdir setup.

Pull Request: https://projects.blender.org/blender/blender/pulls/126563
2024-08-21 15:01:04 +02:00
Bastien Montagne
da814712a5 Fix broken tests build in multi-binaries case.
When `WITH_TESTS_SINGLE_BINARY` is disabled, and `WITH_BUILDINFO` is
enabled, (most of) the generated tests binaries need to link buildinfo.

Pull Request: https://projects.blender.org/blender/blender/pulls/123734
2024-06-26 10:47:33 +02:00
Campbell Barton
a975c7096a Cleanup: line length in CMake files 2024-03-07 13:26:55 +11:00
Brecht Van Lommel
8dfb87d1af Fix: Update tests data path to new directory 2024-02-22 14:25:54 +01:00
Bastien Montagne
f23ee504d0 Tests: Improve the sanitizer options handling.
Previous code was using the 'nuclear' SAN weapon `exitcode=0`, which
essentially makes testing ignore all sanitizer errors.

This commit removes this option, and instead uses the suppression
list from Blender source repository (`tools/config/analysis/lsan.supp`)
for the leak sanitizer.

It also enables the `allocator_may_return_null` for the address sanitizer.
This should only be needed for one test (the `guardedalloc` one), but for
now it is simpler to define it for all tests. This can be refined at a
later time.

Pull Request: https://projects.blender.org/blender/blender/pulls/116635
2024-01-09 14:26:36 +01:00
Campbell Barton
c6485d5947 CMake: quiet undefined variable warnings 2024-01-09 12:38:42 +11:00
Campbell Barton
2783af45ee Cleanup: trailing newlines 2024-01-08 11:31:43 +11:00
Bastien Montagne
3e744db9fe Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.

This does not work, only the last call is effective, all previous
ones have absolutely no effect.

This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.

This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).

NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.

NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
Brecht Van Lommel
364beee159 Tests: add option to build one binary per GTest file
Bundling many tests in a single binary reduces build time and disk space
usage, but is less convenient for running individual tests command line
as filter flags need to be used.

This adds WITH_TESTS_SINGLE_BINARY to generate one executable file per
source file. Note that enabling this option requires a significant amount
of disk space.

Due to refactoring, the resulting ctest names are a bit different than
before. The number of tests is also a bit different depending if this
option is used, as one uses gtests discovery and the other is organized
purely by filename, which isn't always 1:1.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114604
2024-01-03 18:35:50 +01:00
Brecht Van Lommel
f63accd3b6 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/116719
2024-01-03 14:49:11 +01:00
Brecht Van Lommel
4ce14a639f Revert "Cleanup: move CMake test utility functions into testing.cmake"
This breaks execution of some Windows tests.

This reverts commit 4190a61020.
2024-01-02 19:06:39 +01:00
Brecht Van Lommel
4190a61020 Cleanup: move CMake test utility functions into testing.cmake
Combining functions from macros.cmake and Modules/GTestTesting.cmake.
It was unusual to have Blender specific code in the Modules folder.
2024-01-02 15:34:52 +01:00