File tree Expand file tree Collapse file tree 2 files changed +31
-33
lines changed Expand file tree Collapse file tree 2 files changed +31
-33
lines changed Original file line number Diff line number Diff line change
1
+ # Style
2
+
3
+ Please run ` cargo fmt ` before sending pull requests.
4
+
5
+ # Output tests
6
+
7
+ The CI verifies that the PNG outputs do not unexpectedly change for existing
8
+ examples. This is done by checking out the repository before your PR and after
9
+ the PR and comparing the outputs. If you changed some examples deliberately,
10
+ you can indicate this in the PR description by adding a line like:
11
+
12
+ ```
13
+ CHANGED_OUTPUTS=image1.png,image2.png
14
+ ```
15
+
16
+ where ` image1 ` etc is derived from the string you pass to the `c.show(&mut fg,
17
+ "image1");` line in the example. To run the tests manually you run these two
18
+ commands (requires [ uv] ( https://github.com/astral-sh/uv ) to be installed):
19
+
20
+ ``` bash
21
+ source setup_venv.sh # Do this once
22
+ . venv/bin/activate # Do this if you already set up venv
23
+ ./cargo_util.py --make_golden_outputs # On the base commit (typically master)
24
+ ./cargo_util.py --test_outputs --ignore_new_outputs --changed_outputs=image1.png,image2.png # With your changes applied
25
+ ```
26
+
27
+ We don't check in the golden outputs because gnuplot does not guarantee
28
+ cross-platform pixel-perfect outputs, so the outputs end up being specific to
29
+ the platform they're generated on. Thus, we only compare two commits instead on
30
+ the same platform (i.e. your local machine, or the CI runner).
31
+
Original file line number Diff line number Diff line change @@ -54,36 +54,3 @@ A somewhat involved 2D example (see `example1.rs` in the `examples` directory):
54
54
```
55
55
cargo build
56
56
```
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