File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,36 @@ A somewhat involved 2D example (see `example1.rs` in the `examples` directory):
5454```
5555cargo build
5656```
57+
58+ ## Contributing
59+
60+ ### Style
61+
62+ Please run ` cargo fmt ` before sending pull requests.
63+
64+ ### Output tests
65+
66+ The CI verifies that the PNG outputs do not unexpectedly change for existing
67+ examples. This is done by checking out the repository before your PR and after
68+ the PR and comparing the outputs. If you changed some examples deliberately,
69+ you can indicate this in the PR description by adding a line like:
70+
71+ ```
72+ CHANGED_OUTPUTS=image1.png,image2.png
73+ ```
74+
75+ where ` image1 ` etc is derived from the string you pass to the `c.show(&mut fg,
76+ "image1");` line in the example. To run the tests manually you run these two
77+ commands (requires [ uv] ( https://github.com/astral-sh/uv ) to be installed):
78+
79+ ``` bash
80+ source setup_venv.sh # Do this once
81+ . venv/bin/activate # Do this if you already set up venv
82+ ./cargo_util.py --make_golden_outputs # On the base commit (typically master)
83+ ./cargo_util.py --test_outputs --ignore_new_outputs --changed_outputs=image1.png,image2.png # With your changes applied
84+ ```
85+
86+ We don't check in the golden outputs because gnuplot does not guarantee
87+ cross-platform pixel-perfect outputs, so the outputs end up being specific to
88+ the platform they're generated on. Thus, we only compare two commits instead on
89+ the same platform (i.e. your local machine, or the CI runner).
You can’t perform that action at this time.
0 commit comments