Skip to content

Commit 0a4279f

Browse files
committed
Auto merge of rust-lang#2032 - rust-lang:gesundheit, r=oli-obk
Move test suite to ui tests and bless stderr output fixes rust-lang#2027 * [ ] //~ annotations should check that the error happens on their line * [x] document all the things
2 parents 5063880 + f1756c3 commit 0a4279f

File tree

447 files changed

+7306
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

447 files changed

+7306
-447
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contribution Guide
22

3-
If you want to hack on miri yourself, great! Here are some resources you might
3+
If you want to hack on Miri yourself, great! Here are some resources you might
44
find useful.
55

66
## Getting started
@@ -89,6 +89,20 @@ MIRI_LOG=rustc_mir::interpret=info,miri::stacked_borrows ./miri run tests/run-pa
8989
In addition, you can set `MIRI_BACKTRACE=1` to get a backtrace of where an
9090
evaluation error was originally raised.
9191

92+
#### UI testing
93+
94+
We use ui-testing in Miri, meaning we generate `.stderr` and `.stdout` files for the output
95+
produced by Miri. You can use `./miri bless` to automatically (re)generate these files when
96+
you add new tests or change how Miri presents certain output.
97+
98+
Note that when you also use `MIRIFLAGS` to change optimizations and similar, the ui output
99+
will change in unexpected ways. In order to still be able
100+
to run the other checks while ignoring the ui output, use `MIRI_SKIP_UI_CHECKS=1 ./miri test`.
101+
102+
For more info on how to configure ui tests see [the documentation on the ui test crate][ui_test]
103+
104+
[ui_test]: ui_test/README.md
105+
92106
### Testing `cargo miri`
93107

94108
Working with the driver directly gives you full control, but you also lose all
@@ -183,15 +197,15 @@ A big part of the Miri driver lives in rustc, so working on Miri will sometimes
183197
require using a locally built rustc. The bug you want to fix may actually be on
184198
the rustc side, or you just need to get more detailed trace of the execution
185199
than what is possible with release builds -- in both cases, you should develop
186-
miri against a rustc you compiled yourself, with debug assertions (and hence
200+
Miri against a rustc you compiled yourself, with debug assertions (and hence
187201
tracing) enabled.
188202

189203
The setup for a local rustc works as follows:
190204
```sh
191205
# Clone the rust-lang/rust repo.
192206
git clone https://github.com/rust-lang/rust rustc
193207
cd rustc
194-
# Create a config.toml with defaults for working on miri.
208+
# Create a config.toml with defaults for working on Miri.
195209
./x.py setup compiler
196210
# Now edit `config.toml` and under `[rust]` set `debug-assertions = true`.
197211

0 commit comments

Comments
 (0)