Commit Graph

41 Commits

Author SHA1 Message Date
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 89811cb96f Cleanup: unused-imports in tests/ 2023-07-25 21:43:53 +10:00
Campbell Barton 65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Jesse Yurkovich 7699c7407d Tests: Add tests for image format saving and loading
This adds saving and loading tests for our supported image formats.

**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt.  One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing.  The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).

Test flow:
 - Load in an appropriate template image
 - Save it to the desired format with the desired set of options
 - Compare against the reference image

Notes:
 - 98 references are used totaling ~3.6MB
 - 10-12 second test runtime
 - Templates can be reconstructed with the create-templates.blend file

**Loading - bf_imbuf_load.py**
Test flow:
 - Load in each of the reference images
 - Save them back out as .exr
 - Save additional metadata to a secondary file (alpha mode, colorspace etc)
 - Compare the saved out .exr with another set of reference .exrs
 - Compare the saved out file metadata with set of reference metadata

Notes:
 - 98 exr references are used totaling ~10MB
 - 10-12 second test runtime as well

A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.

The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR

Pull Request #104442
2023-02-20 19:06:38 -08:00
Sergey Sharybin 3153bd0f5d SVG: Add more sophisticated test suit
This test suit tests SVG on a big files, as opposite of testing one
specific aspect of the standard by atomic files.
2022-11-10 11:04:30 +01:00
Campbell Barton 1ec7f75b2a Cleanup: format 2022-08-04 07:41:03 +10:00
Jeroen Bakker 3393b7137e RenderReport: Add option to add platform specific overrides.
Reference images in the reference_override_dir will be chosen before
images in reference_dir. This allows platform specific reference
images, with a common base.

Ignored when set to None. The caller is responsible
of setting the reference override dir as the unit test is more aware
what the definition of a platform is.

Patch adds `gpu.platform.device_type_get` function to get the device
type that blender has detected.

Reviewed By: brecht

Maniphest Tasks: T99046

Differential Revision: https://developer.blender.org/D15265
2022-08-01 10:57:32 +02:00
Sybren A. Stüvel 4e96d71ddb Render report: better wording for reference image updating
The old text was suggesting to run `BLENDER_TEST_UPDATE=1 ctest` for
failed tests. Now it's more clear that this is for the regeneration of
reference (ground truth) images, and that it will not touch passing test
cases.

It now also mentions to commit the new reference images to SVN, driving
the point home that this is for updating those, and not for making
failing tests succeed in general.

Over-the-shoulder reviewed by: @sergey
2022-06-14 13:02:39 +02:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton 312d6925c4 Cleanup: make file headers more consistent
Also some descriptive text into doc-strings.
2022-02-09 23:47:34 +11:00
Brecht Van Lommel cc653c9b02 Fix potential render tests error with invalid utf-8 characters
In general should not happen, but better to report the actual error instead
of the Python test code failing.
2021-09-28 20:50:38 +02:00
Campbell Barton 2289e26fa3 Cleanup: correct spelling in comments, remove profanity 2021-07-11 15:31:36 +10: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
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
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
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
Brecht Van Lommel de53178b26 Fix T78777: Cycles motion blur test differences between AVX/AVX2
This appears to be slight precision differences in the Embree implementation,
simply increase the diff threshold a little for these motion blur tests.
2020-08-05 11:45:31 +02:00
Brecht Van Lommel b8567b704b Fix Cycles fluid motion blur not working after recent refactor
This also re-enables the fluid motion blur test.
2020-02-18 17:11:57 +01:00
Sergey Sharybin 002f5b826c Cycles: Disable fluid motion blur regression test
There are deeper issues than just updating the regression test .blend file
and the solution is dragging for far too long.

Considering this a known broken feature, which will either be fixed next week
or completely removed from the interface for the coming release.
2020-01-09 11:40:10 +01:00
Brecht Van Lommel dc216c89e0 Fix render test Python error on crashes 2019-08-26 10:10:35 +02:00
Campbell Barton 760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
Brecht Van Lommel 6f516fcc63 Tests: speed up render tests by running multiple in the same process
Blender startup time and shader compilation is a big factor when running
hundreds of tests, so now all renders in the same ctest run in the same
process.

This was previously reverted due to skipping other tests when one test
crashed. Now if a test crashes, Blender is re-run with the remaining
tests so we get results from them still.
2019-06-27 12:46:04 +02:00
Brecht Van Lommel 51c6dfd7f0 Tests: add navigation links for HTML test reports, and other tweaks 2019-06-26 15:06:49 +02:00
Brecht Van Lommel 3b51260387 Revert "Tests: speed up render tests by running multiple in the same process"
This makes finding the crashing tests harder, reverting until there is a
better solution.

This reverts commit 93901e7f0a.
2019-05-16 15:50:47 +02:00
Brecht Van Lommel 93901e7f0a Tests: speed up render tests by running multiple in the same process
Blender startup time and shader compilation is a big factor when running
hundreds of tests, so now all renders in the same ctest run in the same
process. If a test crashes, the remaining tests in the same category will
be marked as skipped.

Benchmarked on a quad core with ctest -j8.

cycles: 118.1s -> 94.3s
eevee: 66.2s -> 29.2s
workbench: 31.7s -> 8.6s
2019-05-11 00:12:05 +02:00
Brecht Van Lommel 39f78413fc Tests: add tests/report.html that links to all HTML test reports
Currently this is for Cycles, Eevee and workbench tests.
2019-05-09 14:09:55 +02:00
Campbell Barton 733e6c0b1d Merge branch 'master' into blender2.8 2018-10-09 08:46:00 +11:00
Campbell Barton 3bc885e5f4 Cleanup: style 2018-10-09 07:58:06 +11:00
Lukas Stockner 9756475ed6 Tests: Support parallel execution of render tests
Previously, parallel tests would overwrite each others temporary outputs.
2018-10-06 22:12:28 +02:00
Sergey Sharybin d2d0b4fcd7 Merge branch 'master' into blender2.8 2018-09-28 15:03:03 +02:00
Brecht Van Lommel 6dd047c333 Tests: recurse into directories for finding OpenGL draw test .blends. 2018-09-28 14:09:42 +02:00
Campbell Barton 00fc1d70a7 Merge branch 'master' into blender2.8 2018-07-03 06:58:34 +02:00
Campbell Barton 8c15d612a5 Cleanup: pep8 2018-07-03 06:55:02 +02:00
Campbell Barton 9bd0c63382 Merge branch 'master' into blender2.8 2018-06-29 08:05:38 +02:00
Campbell Barton af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
Brecht Van Lommel ffaf55be94 Cycles/Eevee tests: add compare.html to see difference between the engines. 2018-05-18 18:08:01 +02:00
Brecht Van Lommel 6a782ed767 Eevee: add regression tests.
This adds Eevee render tests using the Cycles files. Currently it must
be enabled by setting WITH_OPENGL_RENDER_TESTS=ON. Once we have reference
images we can enable it by default.

Some of the Cycles and Eevee tests are also currently broken due to
modifier and particle changes.

Differential Revision: https://developer.blender.org/D3182
2018-05-18 17:11:24 +02:00
Brecht Van Lommel 3d2d58391a Tests: add OpenGL UI drawing tests.
This reuses the Cycles regression test code to also work for OpenGL UI drawing.
We launch Blender with a bunch of .blend files, take a screenshot and compare
it with a reference screenshot, and generate a HMTL report showing the failed
tests and their differences.

For Cycles we keep small reference renders to compare to in svn, but for OpenGL
developers currently have to generate the references manually. How to use:

* WITH_OPENGL_DRAW_TESTS=ON in CMake
* BLENDER_TEST_UPDATE=1 ctest -R opengl_draw
* .. make code changes ..
* ctest -R opengl_draw
* open build_dir/tests/opengl_draw/report.html

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00
Brecht Van Lommel 0f23f618f3 Tests: split off render report test code from Cycles tests.
This renames test environment variables from CYCLESTEST_* to BLENDER_TEST_*.

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00