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

Commit 86e4066

Browse files
authored
Improved readme for golden tests. (#40679)
Improved readme for impeller golden tests.
1 parent 8cb0803 commit 86e4066

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

impeller/golden_tests/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,18 @@ Example invocation:
1818

1919
Currently these tests are only supported on macOS and only test the Metal
2020
backend to Impeller.
21+
22+
## Adding tests
23+
24+
To add a golden image test, the `impeller_golden_tests` target must be modified
25+
to generate the correct image and modification to its generated `digest.json`.
26+
If a test case is added to [golden_tests.cc](./golden_tests.cc), for example
27+
"GoldenTests.FooBar", that will turn into the golden test
28+
"impeller_GoldenTests_Foobar" automatically if the `SaveScreenshot()` function
29+
is used.
30+
31+
The examples in `golden_tests.cc` use GLFW for rendering the tests, but
32+
technically anything could be used. Using the `SaveScreenshot()` function will
33+
automatically update the `GoldenDigest::Instance()` which will make sure that it
34+
is included in the generated `digest.json`. If that function isn't used the
35+
`GoldenDigest` should be updated manually.

0 commit comments

Comments
 (0)