]> git.lizzy.rs Git - rust.git/blob - COMPILER_TESTS.md
Auto merge of #28248 - PeterReid:master, r=alexcrichton
[rust.git] / COMPILER_TESTS.md
1 # Compiler Test Documentation
2
3 In the Rust project, we use a special set of comands imbedded in
4 comments to test the Rust compiler. There are two groups of commands:
5
6 1. Header commands
7 2. Error info commands
8
9 Both types of commands are inside comments, but header commands should
10 be in a comment before any code.
11
12 ## Summary of Error Info Commands
13
14 Error commands specify something about certain lines of the
15 program. They tell the test what kind of error and what message you
16 are expecting.
17
18 * `~`: Associates the following error level and message with the
19   current line
20 * `~|`: Associates the following error level and message with the same
21   line as the previous comment
22 * `~^`: Associates the following error level and message with the
23   previous line. Each caret (`^`) that you add adds a line to this, so
24   `~^^^^^^^` is seven lines up.
25
26 The error levels that you can have are:
27 1. `ERROR`
28 2. `WARNING`
29 3. `NOTE`
30 4. `HELP` and `SUGGESTION`*
31
32 \* **Note**: `SUGGESTION` must follow emediatly after `HELP`.
33
34 ## Summary of Header Commands
35
36 Header commands specify something about the entire test file, as a
37 whole, instead of just a few lines inside the test.
38
39 * `ignore-X` where `X` is an architecture, OS or stage will ignore the test accordingly
40 * `ignore-pretty` will not compile the pretty-printed test (this is done to test the pretty-printer, but might not always work)
41 * `ignore-test` always ignores the test
42 * `ignore-lldb` and `ignore-gdb` will skip the debuginfo tests
43 * `min-{gdb,lldb}-version`