Skip to content

Commit

Permalink
Documentation update and make the golden image error message point to… (
Browse files Browse the repository at this point in the history
#24490)

* Documentation update and make the golden image error message point to docs and command to run

* Restyle

* Undo file change that was made to test the error reporting

* Fix typo s/regenerata/regenerate
  • Loading branch information
andy31415 authored and pull[bot] committed Apr 21, 2023
1 parent c5a4967 commit 9916772
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/code_generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,10 @@ replacement during running of `ninja check`.
```shell
ZAP_GENERATE_GOLDEN_REGENERATE=1 ninja check
```

Alternatively, the golden image can also be re-generated by running the
stand-alone test in a bootstrapped environment:

```shell
./scripts/tools/zap/test_generate.py --output out/gen --regenerate
```
6 changes: 6 additions & 0 deletions scripts/tools/zap/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ def run_test_cases(self, checker: unittest.TestCase):
f"Copying updated golden image from {actual} to {expected}")
subprocess.check_call(["cp", actual, expected])
else:
print("*"*80)
print("* Golden image regeneration seems to have failed.")
print("* Documentation regarding code-generation logic available at docs/code_generation.md")
print("*\n* Specifically to update golden images, you may want to run:")
print("*\n* ./scripts/tools/zap/test_generate.py --output out/gen --regenerate")
print("*\n" + "*"*80)
raise


Expand Down

0 comments on commit 9916772

Please sign in to comment.