Photon 2.0.0-beta
A physically based renderer.
|
This directory (./Main/RenderTest/
) contains the primary end-to-end tests for Photon renderer. Do not run the test directly in this directory. After setup (by running the setup script in project root), the test will be installed to the build directory and you can run it from there. As always, use the build directory as the working directory when running tests.
Multiple dependencies are needed in order to run render tests. You can install them in one go by executing pip install -r ./RenderTest/requirements.txt
(in the build directory, presumably under an virtual environment).
In the build directory, you can run tests using
or run and produce a markdown report with
Running tests under a Python virtual environment can be beneficial, as the packages installed are the exact versions we required and is less likely to interfere with other projects. First, create a virtual environment under the build directory with
This will create a directory named RenderTestEnv
(or the name of your choice). To start using the virtual environment we just created, execute the following command:
After this, you can execute pip install -r ./RenderTest/requirements.txt
to install all dependencies and run the tests with python ./RenderTest/run_and_report.py
.
python3
to run the python scripts instead.Most tests already utilizes threading provided by Photon itself. However, tests run by pytest
is sequential by default. You can install the pytest-xdist
plugin (pip install pytest-xdist
) and run tests across multiple CPU cores. For example, to run tests using 20 CPU cores, you can execute the following command:
You can use the keyword expressions provided by pytest. For example, to run test_fullscreen_unit_radiance
, you can use
If you do not follow the pattern of existing tests, please keep in mind that the tests can run in parallel (e.g., using xdist
). All tests must be written in a thread-safe and process-safe way.