]> git.lizzy.rs Git - rust.git/blob - ui_test/README.md
Auto merge of #2167 - rust-lang:gesundheit, r=RalfJung
[rust.git] / ui_test / README.md
1 A smaller version of compiletest-rs
2
3 ## Supported magic comment annotations
4
5 Note that the space after `//`, when it is present, is *not* optional -- it must be exactly one.
6
7 * `// ignore-XXX` avoids running the test on targets whose triple contains `XXX`
8     * `XXX` can also be one of `64bit`, `32bit` or `16bit`
9 * `// only-XXX` avoids running the test on targets whose triple **does not** contain `XXX`
10     * `XXX` can also be one of `64bit`, `32bit` or `16bit`
11 * `// stderr-per-bitwidth` produces one stderr file per bitwidth, as they may differ significantly sometimes
12 * `// error-pattern: XXX` make sure the stderr output contains `XXX`
13 * `//~ ERROR: XXX` make sure the stderr output contains `XXX` for an error in the line where this comment is written
14     * Also supports `HELP`, `WARN` or `NOTE` for different kind of message
15         * if one of those levels is specified explicitly, *all* diagnostics of this level or higher need an annotation. If you want to avoid this, just leave out the all caps level note entirely.
16     * If the all caps note is left out, a message of any level is matched. Leaving it out is not allowed for `ERROR` levels.
17     * This checks the output *before* normalization, so you can check things that get normalized away, but need to
18       be careful not to accidentally have a pattern that differs between platforms.
19 * `// revisions: XXX YYY` runs the test once for each space separated name in the list
20     * emits one stderr file per revision
21     * `//~` comments can be restricted to specific revisions by adding the revision name before the `~` in square brackets: `//[XXX]~`
22 * `// compile-flags: XXX` appends `XXX` to the command line arguments passed to the rustc driver
23 * `// rustc-env: XXX=YYY` sets the env var `XXX` to `YYY` for the rustc driver execution.
24     * for Miri these env vars are used during compilation via rustc and during the emulation of the program
25 * `// normalize-stderr-test: "REGEX" -> "REPLACEMENT"` replaces all matches of `REGEX` in the stderr with `REPLACEMENT`. The replacement may specify `$1` and similar backreferences to paste captures.
26
27 ## Significant differences to compiletest-rs
28
29 * `ignore-*` and `only-*` opereate solely on the triple, instead of supporting things like `macos`
30 * only `//~` comments can be individualized per revision