You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ui_test/README.md
+25-13Lines changed: 25 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -7,25 +7,37 @@ A smaller version of compiletest-rs
7
7
8
8
## Supported magic comment annotations
9
9
10
-
*`// ignore-XXX` avoids running the test on targets whose triple contains `XXX`
10
+
If your test tests for failure, you need to add a `//~` annotation where the error is happening
11
+
to make sure that the test will always keep failing with a specific message at the annotated line.
12
+
13
+
`//~ ERROR: XXX` make sure the stderr output contains `XXX` for an error in the line where this comment is written
14
+
15
+
* Also supports `HELP`, `WARN` or `NOTE` for different kind of message
16
+
* 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.
17
+
* If the all caps note is left out, a message of any level is matched. Leaving it out is not allowed for `ERROR` levels.
18
+
* This checks the output *before* normalization, so you can check things that get normalized away, but need to
19
+
be careful not to accidentally have a pattern that differs between platforms.
20
+
21
+
In order to change how a single test is tested, you can add various `//@` comments to the test.
22
+
Any other comments will be ignored, and all `//@` comments must be formatted precisely as
23
+
their command specifies, or the test will fail without even being run.
24
+
25
+
*`//@ignore-XXX` avoids running the test on targets whose triple contains `XXX`
11
26
*`XXX` can also be one of `64bit`, `32bit` or `16bit`
12
-
*`//only-XXX` avoids running the test on targets whose triple **does not** contain `XXX`
27
+
*`//@only-XXX` avoids running the test on targets whose triple **does not** contain `XXX`
13
28
*`XXX` can also be one of `64bit`, `32bit` or `16bit`
14
-
*`//stderr-per-bitwidth` produces one stderr file per bitwidth, as they may differ significantly sometimes
29
+
*`//@stderr-per-bitwidth` produces one stderr file per bitwidth, as they may differ significantly sometimes
15
30
*`//@error-pattern: XXX` make sure the stderr output contains `XXX`
16
-
*`//~ ERROR: XXX` make sure the stderr output contains `XXX` for an error in the line where this comment is written
17
-
* Also supports `HELP`, `WARN` or `NOTE` for different kind of message
18
-
* 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.
19
-
* If the all caps note is left out, a message of any level is matched. Leaving it out is not allowed for `ERROR` levels.
20
-
* This checks the output *before* normalization, so you can check things that get normalized away, but need to
21
-
be careful not to accidentally have a pattern that differs between platforms.
22
-
*`// revisions: XXX YYY` runs the test once for each space separated name in the list
31
+
*`//@revisions: XXX YYY` runs the test once for each space separated name in the list
23
32
* emits one stderr file per revision
24
33
*`//~` comments can be restricted to specific revisions by adding the revision name before the `~` in square brackets: `//[XXX]~`
25
-
*`// compile-flags: XXX` appends `XXX` to the command line arguments passed to the rustc driver
26
-
*`// rustc-env: XXX=YYY` sets the env var `XXX` to `YYY` for the rustc driver execution.
34
+
*`//@compile-flags: XXX` appends `XXX` to the command line arguments passed to the rustc driver
35
+
* you can specify this multiple times, and all the flags will accumulate
36
+
*`//@rustc-env: XXX=YYY` sets the env var `XXX` to `YYY` for the rustc driver execution.
27
37
* for Miri these env vars are used during compilation via rustc and during the emulation of the program
28
-
*`// 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.
38
+
* you can specify this multiple times, accumulating all the env vars
39
+
*`//@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.
40
+
* you can specify multiple such commands, there is no need to create a single regex that handles multiple replacements that you want to perform.
0 commit comments