Makes it slightly easier to test whether the installed module works
or not. Depends on D10656
Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10665
Avoid CTest errors and exit codes due to test failures which depend
on Blender executable.
Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10656
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.
The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.
NOTE: This is an experimental feature and should not be used in productions.
Reviewed By: mont29, sebbas
Differential Revision: https://developer.blender.org/D10792
Added support for compositor tests. Compositor tests can be added, executed and viewed in a similar way to cycles
and other render engines tests.
Running test:
`ctest -R compositor`
Updating test:
`BLENDER_TEST_UPDATE=1 ctest -R compositor`
Viewing test results:
typically saved under `build_folder/tests/compositor/report.html`
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6334
Added a first test case for review. This will be the base for future test cases.
The current API is sufficient for what is expected for such a low level API.
One concern is that you need to trigger a save in order to update the library overrides
structure. Not expected from TD/Dev point of view.
Test cases are very important when implementing restrictive mode as it is a second evaluation mode that
has impact on the (current) permissive mode.
Reviewed By: Sebastián Barschkis, Bastien Montagne
Differential Revision: https://developer.blender.org/D10747
This checks the generated key-map data matches the result of
re-exporting and re-importing.
This shows up various inconsistencies, including:
- Unused keymaps.
- Unknown/unused data in the keymap.
- Event arguments that don't make sense.
- Event values that don't match the event type
(tweak direction on keyboard event for example).
When building `install`, linking blender_test fails because
test libraries do not exist. This happened on lite + Xcode. Error in
{rBdcb2821292f962951e88f146cb304160f21f73da}.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10607
MeshTest now compares selection between evaluated mesh and expected mesh. This way, we can test more operators
such as `faces_select_linked_flat`
Note: selection comparison intentionally does not happen in BKE_mesh_cmp() on C side but rather on Python side, because
selection is independent of mesh generation.
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10279
Print number of total tests with each test to show how many tests have been executed and how many are left.
Example: `Running test 27/36: PlaneFaceSplitByEdges...`
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10278
Tests are not identified with indexes, so no need to maintain comments with indexes anymore
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10277
Group all tests of a test suite into a single test command invocation.
This reduces the number of invocations by `ctest` by an order of
magnitude.
Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every
individual test. Having over a 1000 tests made testing slower than
necessary. Individual tests can still be run if desired by invocation of
`bin/tests/blender_test --gtest_filter=suitename.testname`.
NOTE: For this commit to have an immediate effect, it may be necessary
to remove the `tests` and `Testing` directories and some CMake files
from your build directory and rebuild. Run `ctest -N` to see the list of
tests; there should be less than 200.
Reviewed By: sergey, LazyDodo, sebbas
Maniphest Tasks: T83222
Differential Revision: https://developer.blender.org/D9649
When building opensubdiv with more aggressive optimization flags
(-march=native -02) the output meshes would differ a bit from what we
expected in the current automated modifier test file.
The differences in vertex position is within the 1e-6 range, which I
would call is acceptable for floats. In addition to this, all the
modifier test that tests the subdiv modifier in particular pass without
any modifications. I've updated two tests in the modifier test file and
script to make it pass (listed below).
Updated following test categories:
1. Decimate test
Here there was a subdiv modifier applied before the actual decimate
modifier. Because the decimate modifier creates a queue of potential
vertices it can remove, it is highly sensitive to even small changes as
it drastically changes in which order the vertices are decimated in.
As this test should only be testing the decimate modifier, I pre-applied
the subdiv modifier in the test file.
2. RandomCubeModifier
For these tests I removed the subdiv modifier as well. As with decimate,
a small change in vertex position here can lead to quite different
results.
Reviewed By: Sergey, Bastien
Differential Revision: http://developer.blender.org/D9004
This adds a basic set of tests for curve sampling and bevel generation.
At the moment there are basic test cases for bevels, caps, and the
filling of 2D curves, but more tests can be added in the future.
Curves are actually converted to "DispLists" for displaying them in the
viewport, so it's much simpler to rely on the mesh conversion operator
instead of building a new test framework for another data structure.
Differential Revision: https://developer.blender.org/D9958
This revision contains the following changes-
- Updated the existing testing framework for Modifiers for Regression
Testing.
- Tests for Physics modifiers and remaining Generate and Deform modifiers are added.
- The existing `ModifierSpec` is updated with backward compatibility to support Physics Modifiers.
- Now there is support for frame number and giving nested parameters for attributes.
- Some Deform modifiers required Object Operators, e.g. "Bind" in Mesh Deform, so a new class was added to support that functionality.
- A separate class for holding Particles System, they are tested by converting all the particles to mesh and joining it to the mesh they were added.
- Updated the format to add tests for Bevel, Boolean and Operators as
well.
Reviewed By: zazizizou, mont29, campbellbarton
Differential Revision: https://developer.blender.org/D8507
Add Custom Space to the list of space conversions for constraints.
Constraints can use World Space, Local Space, Pose Space, Local with
Parent, and now also Custom Space with a custom object to define the
evaluation space.
The Custom Space option uses the Local Space of an other
object/bone/vertex group. If selected on owner or target it will show a
box for object selection. If an armature is selected, then it will also
show a box for bone selection. If a mesh object is selected it will show
the option for using the local space of a vertex group.
Reviewed By: #animation_rigging, sybren, Severin, angavrilov
Differential Revision: https://developer.blender.org/D7437
Blacklist a bunch of tests on the GPU, which are known to currently have
differences with CPU. These can be enabled as they are fixed or the test
is modified to give compatible results when there are known limitations.
OSL tests were also moved to their own directory since those are not
supported on the GPU.
Ref T82193
CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set
to CPU only by default.
Test output is now writen to build/tests/cycles/<device>, and the HTML report
has separate report pages for the different devices, with option to compare
between CPU and GPU renders.
Various GPU tests are still failing due to CPU/GPU differences, these are to be
fixed or blacklisted still.
Ref T82193
This new discontinuity filter performs actions on the entire Euler
rotation, rather than only on the individual X/Y/Z channels. This makes
it fix a wider range of discontinuities, for example those in T52744.
The filter now runs twice on the selected channels, in this order:
- New: Convert X+Y+Z rotation to matrix, then back to Euler angles.
- Old: Add/remove factors of 360° to minimize jumps.
The messaging is streamlined; it now reports how many channels were
filtered, and only warns (instead of errors) when there was an actual
problem with the selected channels (like selecting three or more
channels, but without X/Y/Z triplet).
A new kernel function `BKE_fcurve_keyframe_move_value_with_handles()` is
introduced, to make it possible to move a keyframe's value and move its
handles at the same time.
Manifest Task: T52744
Reviewed By: looch
Differential Revision: https://developer.blender.org/D9602
Expand unit test for `BKE_fcurve_active_keyframe_index()` to test edge
cases better.
This also introduces a new test macro `EXPECT_BLI_ASSERT()`, which can be
used to test that an assertion fails successfully.
No functional changes to actual Blender code.
Tests files are based on test from D8393
Test files should be in `lib\tests\sequence_editing`
These are files, I will add few more tests including animation test.
{F9155273}
Using generic tool to compare rendered vs reference image as other render engines.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9394
Don't override other `LSAN_OPTIONS` like suppression file set in
the environment variable.
Old code added in {rB38ff5064b33ccb8} and {rB5f4e99b7a2b8376}
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9207
More agressive optimization made the results differ a bit more than the
current error margin would allow. Bump the error margin to be 1e-6
instead of the previous 0.5e-7.
Relax limits of FCurve Bézier handles during evaluation. FCurve handles
can be scaled down to avoid the curve looping backward in time. This
scaling was done correctly but over-carefully, posing unnecessary
limitations on the possible slope of FCurves. This commit changes the
scaling approach such that the FCurve can become near-vertical.
Bump Blender's subversion from 291.0.1 to 291.0.2 to ensure that older
animation files are correctly updated.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8752
Write custom properties (aka ID properties) to Alembic, to the
`.userProperties` compound property.
Manifest Task: https://developer.blender.org/T50725
Scalar properties (so single-value/non-array properties) are written as
single-element array properties to Alembic. This is also what's done by
Houdini and Maya exporters, so it seems to be the standard way of doing
things. It also simplifies the implementation.
Two-dimensional arrays are flattened by concatenating all the numbers
into a single array. This is because ID properties have a limited type
system. This means that a 3x3 "matrix" could just as well be a list of
three 3D vectors.
Alembic has two container properties to store custom data:
- `.userProperties`, which is meant for properties that aren't
necessarily understood by other software packages, and
- `.arbGeomParams`, which can contain the same kind of data as
`.userProperties`, but can also specify that these vary per face of a
mesh. This property is mostly intended for renderers.
Most industry packages write their custom data to `.arbGeomParams`.
However, given their goals I feel that `.userProperties` is the more
appropriate one for Blender's ID Properties.
The code is a bit more involved than I would have liked. An
`ABCAbstractWriter` has a `uniqueptr` to its `CustomPropertiesExporter`,
but the `CustomPropertiesExporter` also has a pointer back to its owning
`ABCAbstractWriter`. It's the latter pointer that I'm not too happy
with, but it has a reason. Getting the aforementioned `.userProperties`
from the Alembic library will automatically create it if it doesn't
exist already. If it's not used to actually add custom properties to, it
will crash the Alembic CLI tools (and maybe others too). This is what
the pointer back to the `ABCAbstractWriter` is used for: to get the
`.userProperties` at the last moment, when it's 100% sure at least one
custom property will be written.
Differential Revision: https://developer.blender.org/D8869
Reviewed by: sergey, dbystedt
These were disabled in the newboolean merge commit.
This commit renables them, using the original 'FAST' solver
so that the result objects need not change.
A TODO to add more tests using the 'EXACT' solver,
though most functionality there is now covered by unit gtests.
This is for design task T67744, Boolean Redesign.
It adds a choice of solver to the Boolean modifier and the
Intersect (Boolean) and Intersect (Knife) tools.
The 'Fast' choice is the current Bmesh boolean.
The new 'Exact' choice is a more advanced algorithm that supports
overlapping geometry and uses more robust calculations, but is
slower than the Fast choice.
The default with this commit is set to 'Exact'. We can decide before
the 2.91 release whether or not this is the right choice, but this
choice now will get us more testing and feedback on the new code.
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
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.
Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.
Reviewed By: Sergey
Differential Revision: https://developer.blender.org/D8595
Rename test `alembic_tests` to `alembic_export_tests`, so that its name
is consistent with the Python file containing the tests,
`alembic_export_tests.py`.
No functional changes.
Instead of checking for the length of a list, just handle the error that
occurs when the length is incorrect.
No functional changes to any actual test.
And make them part of the blender_test runner. The one exception is blenlib
performance tests, which we don't want to run by default. They remain in their
own executable.
Differential Revision: https://developer.blender.org/D8498
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
Add our own copy of the gtest discovery scripts from CMake a few reasons:
* Use the very latest version which supports PRE_TEST for Windows
* Fix usage of [] symbols in file paths that fail with the zsh shell
* Disable asan leak checker when discovering tests
This means Windows also no longer requires the very latest CMake 3.18.
This bumps the minimum requirement for cmake from 3.10 to 3.18 on windows
if `WITH_GTESTS` is enabled.
Reviewed By: sergey brecht sybren campbellbarton
Differential Revision: https://developer.blender.org/D8405
The buildbot uses a separate `CMAKE_INSTALL_PREFIX`. This means that
the unit test could not find its USD JSON files in the build directory.
Using `${CMAKE_INSTALL_PREFIX}` instead of `$<TARGET_FILE_DIR:blender>`
solved this.
MSVC does need the wholearchive flag but it was not set,
so no tests were actually linked into the binary.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8404
When definining static variables that own memory, you should
use the "construct on first use" idiom. Otherwise, you'll get
a warning when Blender exits.
More details are provided in D8354.
Differential Revision: https://developer.blender.org/D8354
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
Implementation of lerp without a function requires repeating one of
the arguments, which is not ideal. To avoid that, add a new function
to the driver namespace. In addition, provide a function for clamping
between 0 and 1 to support easy clamped lerp, and a smoothstep function
from GLSL that is somewhat related.
The function implementations are added to a new bl_math module.
As an aside, add the round function and two-argument log to the
pylike expression subset.
Differential Revision: https://developer.blender.org/D8205
This updates the usage of integer types in code I wrote according to our new style guides.
Major changes:
* Use signed instead of unsigned integers in many places.
* C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`).
* Hash values for C++ containers are 64 bit wide now (instead of 32 bit).
I do hope that I broke no builds, but it is quite likely that some compiler reports
slightly different errors. Please let me know when there are any errors. If the fix
is small, feel free to commit it yourself.
I compiled successfully on linux with gcc and on windows.
Instead of depending on static initialization order of globals use
static variables within functions. Those are initialized on first use.
This is every so slighly less efficient, but avoids a full class of problems.
CMake, when it's configuring the project, runs the `blender_test` test
runner (if it exists from a previous build) to discover which tests it
contains. At this time none of the tests themselves are run, so it's not
that useful to run ASAN and have it break things when there are memory
leaks.
This commit disables ASAN by injecting `ASAN_OPTIONS="detect_leaks=0"` in
the environment variables.
It is not enough to use `set(ENV{ASAN_OPTIONS} "detect_leaks=0")` in
`tests/gtests/runner/CMakeLists.txt`, as it wouldn't be passed to the child
process.
This commit is a followup of {D7649}, and ports the USD tests to the new
testing approach. It moves test code from `tests/gtests/usd` into
`source/blender/io/common` and `source/blender/io/usd`, and adjusts the
use of namespaces to be consistent with the other tests.
I decided to put one test into `io/usd/tests`, instead of
`io/usd/intern`. The reason is that this test does not correspond with a
single file in that directory; instead, it tests Blender's integration
with the USD library itself.
There are two new CLI arguments for the Big Test Runner:
- `--test-assets-dir`, which points to the `lib/tests` directory in the
SVN repository. This allows unit tests to find test assets.
- `--test-release-dir`, which points to `bin/{BLENDER_VERSION}` in the
build directory. At the moment this is only used by the USD test.
The CLI arguments are automatically passed to the Big Test Runner when
using `ctest`. When manually running the tests, the arguments are only
required when there is a test run that needs them.
For more info about splitting some code into 'common', see
rB084c5d6c7e2cf8.
No functional changes to the tests themselves, only to the way they are
built & run.
Differential Revision: https://developer.blender.org/D8314
Reviewed by: brecht, mont29
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