Skip to content

Commit

Permalink
docs: more tweaking of the gold-file instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Apr 1, 2023
1 parent b8498bf commit acd1e03
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions tests/gold/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ current output of the tests into the gold files. When a test fails, the actual
output is in the tests/actual directory. Those files are ignored by git.

There's a Makefile in the html directory for working with gold files and their
associated support files. If actual outputs have changed so that comparisons
are failing, but the new output is correct, you can use "make update-gold" to
copy the actual output as the new gold files.
associated support files.

To view the tests/actual files, you need to tentatively copy them to the gold
directories, and then add the supporting files so they can be viewed as
complete output. For example::

cp tests/actual/html/contexts/* tests/gold/html/contexts
cd tests/actual/html
make complete

If the new actual output is correct, you can use "make update-gold" to copy the
actual output as the new gold files.

If you have changed some of the supporting files (.css or .js), then "make
update-support" will copy the updated files to the tests/gold/html/support
directory for checking test output.

If you have added a gold test, you'll need to manually copy the tests/actual
files to tests/gold.
Expand All @@ -27,8 +40,9 @@ again, you can run just the failed tests again with::
The saved HTML files in the html directories can't be viewed properly without
the supporting CSS and Javascript files. But we don't want to save copies of
those files in every subdirectory. The make target "make complete" in
tests/gold/html will copy the support file so you can open the HTML files to
see how they look.
tests/gold/html will copy the support files so you can open the HTML files to
see how they look. When you are done checking the output, you can use "make
clean" to remove the support files from the gold directories.

If the output files are correct, you can update the gold files with "make
update-gold". If there are version-specific gold files (for example,
Expand Down

0 comments on commit acd1e03

Please sign in to comment.