Skip to content

Commit 417b6d1

Browse files
committed
---
yaml --- r: 272759 b: refs/heads/beta c: 1d76ccd h: refs/heads/master i: 272757: cc1d7f7 272755: 562dc2a 272751: 90baa0e
1 parent cd1b5ad commit 417b6d1

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 3fb80e33a89709e3457ad0943f5847eb5800d620
26+
refs/heads/beta: 1d76ccd9d45e818e0554c8ce491d5ed20130e9c8
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/COMPILER_TESTS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,34 @@ whole, instead of just a few lines inside the test.
4242
* `ignore-test` always ignores the test
4343
* `ignore-lldb` and `ignore-gdb` will skip the debuginfo tests
4444
* `min-{gdb,lldb}-version`
45+
46+
## Revisions
47+
48+
Certain classes of tests support "revisions" (as of the time of this
49+
writing, this includes run-pass, compile-fail, run-fail, and
50+
incremental, though incremental tests are somewhat
51+
different). Revisions allow a single test file to be used for multiple
52+
tests. This is done by adding a special header at the top of the file:
53+
54+
```
55+
// revisions: foo bar baz
56+
```
57+
58+
This will result in the test being compiled (and tested) three times,
59+
once with `--cfg foo`, once with `--cfg bar`, and once with `--cfg
60+
baz`. You can therefore use `#[cfg(foo)]` etc within the test to tweak
61+
each of these results.
62+
63+
You can also customize headers and expected error messages to a particular
64+
revision. To do this, add `[foo]` (or `bar`, `baz`, etc) after the `//`
65+
comment, like so:
66+
67+
```
68+
// A flag to pass in only for cfg `foo`:
69+
//[foo]compile-flags: -Z verbose
70+
71+
#[cfg(foo)]
72+
fn test_foo() {
73+
let x: usize = 32_u32; //[foo]~ ERROR mismatched types
74+
}
75+
```

0 commit comments

Comments
 (0)