Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Improved readme for impeller golden tests. #40679

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions impeller/golden_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ Example invocation:

Currently these tests are only supported on macOS and only test the Metal
backend to Impeller.

## Adding tests

To add a golden image test, the `impeller_golden_tests` target must be modified
to generate the correct image and modification to its generated `digest.json`.
If a test case is added to [golden_tests.cc](./golden_tests.cc), for example
"GoldenTests.FooBar", that will turn into the golden test
"impeller_GoldenTests_Foobar" automatically if the `SaveScreenshot()` function
is used.

The examples in `golden_tests.cc` use GLFW for rendering the tests, but
technically anything could be used. Using the `SaveScreenshot()` function will
automatically update the `GoldenDigest::Instance()` which will make sure that it
is included in the generated `digest.json`. If that function isn't used the
`GoldenDigest` should be updated manually.