Commit Graph

819 Commits

Author SHA1 Message Date
Campbell Barton 7e850ffa73 Cleanup: cmake indentation, white-space 2021-02-05 09:45:16 +11:00
Ankit Meel dcb2821292 macOS/GTest: Fix duplicate symbol errors with some generators
Don't force load _and_ link against a library in case
linker fails to deduplicate them.
https://devtalk.blender.org/t/macos-duplicate-symbol-errors/17343

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10294
2021-02-03 23:20:27 +05:30
Sebastian Parborg 74f6b81c12 Tests: skip OSL render tests in build without OSL
Differential Revision: https://developer.blender.org/D9990
2021-01-14 13:14:43 +01:00
Brecht Van Lommel 4e90266fd8 Tests: enable bake and shader raytracing tests for OptiX
These are now supported and so can be tested.

Also refactor the code a bit to move Cycles specific blacklist out of generic
render test code.
2021-01-14 13:14:43 +01:00
Hans Goudey 3f7c294a95 Mix modifiers test after commit to bevel modifier defaults
{rB6b5e4ad5899d} neglected to update the modifier tests to reflect
the fact that the default limit method is no longer "NONE".
2021-01-12 23:54:46 -06:00
Sybren A. Stüvel b2ad52a763 Tests: skip unit test if built without ocean sim modifier
Disable the Ocean Sim test when building with `WITH_MOD_OCEANSIM=OFF`.
2021-01-12 13:50:29 +01:00
Sybren A. Stüvel 54f8a5dd73 Tests: run suites instead of individual test cases
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
2021-01-11 11:29:30 +01:00
Himanshi Kalra 7241104877 Enabled Physics Particle Instance test 2021-01-05 16:16:08 +05:30
Sebastian Parborg 8c80299fc4 Make mesh modifier tests not fail with optimized OSD lib
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
2021-01-04 19:30:20 +01:00
Hans Goudey 8373f497bd Add regression tests for curve conversion to mesh
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
2020-12-30 13:12:29 -06:00
Hans Goudey 761ef45a24 Cleanup: Fix typo in tests error message 2020-12-29 20:46:29 -06:00
Sergey Sharybin 5428ad40e8 Test: Add utility to do near comparison for float[2] 2020-12-29 10:38:38 +01:00
Himanshi Kalra e7b698327c Updated and extended Regression Testing frameworks (Gsoc 2020)
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
2020-12-17 20:58:20 +05:30
Campbell Barton e21f1136c2 Tests: fix 'ctest -j' running multiple tests at once
bl_blendfile_io & bl_blendfile_liblink shared a filename,
which could make these tests fail.
2020-12-10 17:18:38 +11:00
Brecht Van Lommel b14b57fc05 Fix failing Eevee render tests after recent changes 2020-12-07 17:09:34 +01:00
Henrik Dick a6c4e39876 Add Custom Object Space to Constraints
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
2020-12-03 11:20:21 +01:00
Brecht Van Lommel 2a430a670c Tests: blacklist failing tests for Cycles CUDA and OptiX devices
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
2020-11-30 13:40:33 +01:00
Brecht Van Lommel dd391d38f6 Tests: add CMake option to run Cycles regression tests on GPU devices
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
2020-11-30 13:40:33 +01:00
Sybren A. Stüvel e4ca1fc4ea Animation: New Euler filter implementation
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
2020-11-23 12:48:04 +01:00
Sybren A. Stüvel feb71f1d71 Animation: Expand unit tests for `BKE_fcurve_active_keyframe_index()`
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.
2020-11-10 15:36:21 +01:00
Brecht Van Lommel b1efea986d Fix sequence tests writing HTML report to wrong directory
It was missing from tests/report.html that gathers all tests reports.
2020-11-03 13:31:31 +01:00
Richard Antalik c887a50f62 Add sequencer transform tests
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
2020-11-01 21:34:18 +01:00
Ankit Meel a181b15639 Tests: use environment variable for leak sanitizer
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
2020-10-14 16:53:49 +05:30
Campbell Barton 41d2d6da0c Cleanup: pep8 (indentation, spacing, long lines) 2020-10-02 11:59:16 +10:00
Campbell Barton bab9de2a52 Cleanup: pep8, blank lines 2020-10-02 11:59:16 +10:00
Campbell Barton 28ebe827e6 Cleanup: trailing space 2020-10-02 11:59:16 +10:00
Henrik Dick bea4505744 Fix Tests for Weld Modifier with KD-Tree
Fixes the failing tests and reintroduces the KD-Tree solution.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D9013
2020-09-25 15:17:02 -03:00
Sebastian Parborg 6877a7b3ff Fix running tests when building without portable install. 2020-09-24 18:34:55 +02:00
Sebastian Parborg 331f383337 Fix blender constraints automated tests when using march=native
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.
2020-09-24 18:33:36 +02:00
Brecht Van Lommel f9fcb25d52 CMake: clean up setting of platform specific linker flags
Set flags directly on the target, and use common function for all cases.
This refactoring helps with the next commit for test executables.

Ref D8714
2020-09-17 12:29:19 +02:00
Campbell Barton dd25d47e8a Cleanup: add missing headers to CMake, formatting 2020-09-15 22:53:44 +10:00
TonyG da95d1d851 Fix T75881: Animation, limitation of Bézier Handles
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
2020-09-15 13:08:18 +02:00
Sybren A. Stüvel ee97add4c4 Alembic export: write custom properties
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
2020-09-14 12:49:27 +02:00
Howard Trickey 3699d6fe34 Re-enable modifer and bmesh_boolean tests.
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.
2020-08-30 08:31:40 -04:00
Howard Trickey 9e09b5c418 Merge newboolean branch into master.
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.
2020-08-28 11:01:06 -04: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
Jacques Lucke 48bd6e7102 Tests: use guarded allocator in tests
This helps finding memory leaks in tests.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8631
2020-08-19 18:18:20 +02:00
Sybren A. Stüvel ac41215f07 Tests: fix Alembic export test on Windows
Convert all `subprocess.run()` arguments to string, to prevent breaking
"does this argument need quoting" checks on Windows.
2020-08-17 20:08:01 +02:00
Sybren A. Stüvel a95f863596 Fix T75936: Alembic, allow exporting of invisible objects
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
2020-08-17 17:56:05 +02:00
Sybren A. Stüvel 04ae290024 Cleanup: Alembic, rename test in CMake for consistency
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.
2020-08-17 17:56:05 +02:00
Sybren A. Stüvel 449ccb7b30 Fix typo: missing `f` string prefix in Alembic export test 2020-08-17 15:16:20 +02:00
Sybren A. Stüvel 6b6de5beba Cleanup: Alembic tests, add note explaining how the export tests work
No functional changes.
2020-08-17 14:07:45 +02:00
Sybren A. Stüvel ad459302ce Cleanup: rename `alembic_tests.py` to `alembic_tests_export.py`
Rename `alembic_tests.py` to `alembic_tests_export.py`, as this makes it
clearer what is being tested.

No functional changes.
2020-08-17 14:07:45 +02:00
Sybren A. Stüvel 4a2ff0fef8 Tests: Better error reporting in `AbstractAlembicTest`
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.
2020-08-17 14:07:45 +02:00
Sybren A. Stüvel 38752944f8 Fix formatting bug in `AbstractAlembicTest` class
Replace `formatstring, value` with the correct `formatstring % value`.

No functional changes to any actual tests.
2020-08-17 14:07:45 +02:00
Brecht Van Lommel 53d203dea8 Tests: move remaining gtests into their own module folders
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
2020-08-10 18:14:00 +02:00
Sergey Sharybin 2c5c39d53c Merge branch 'blender-v2.90-release' 2020-08-05 13:00:15 +02:00
Sergey Sharybin 02ccc37144 Correct recent fix for Cycles motion blur test
Need to only compare directory name, not the whole path.
2020-08-05 12:59:28 +02:00
Julian Eisel fc9f7e3e51 Merge branch 'blender-v2.90-release' 2020-08-05 12:19:28 +02:00
Brecht Van Lommel ec9ab00fcb Fix failing USD test on macOS after becoming part of blender test runner 2020-08-05 12:15:17 +02:00