1.5 KiB
1.5 KiB
Compiler Test Documentation
In the Rust project, we use a special set of commands embedded in comments to test the Rust compiler. There are two groups of commands:
- Header commands
- Error info commands
Both types of commands are inside comments, but header commands should be in a comment before any code.
Summary of Error Info Commands
Error commands specify something about certain lines of the program. They tell the test what kind of error and what message you are expecting.
~: Associates the following error level and message with the current line~|: Associates the following error level and message with the same line as the previous comment~^: Associates the following error level and message with the previous line. Each caret (^) that you add adds a line to this, so~^^^^^^^is seven lines up.
The error levels that you can have are:
ERRORWARNINGNOTEHELPandSUGGESTION*
* Note: SUGGESTION must follow immediately after HELP.
Summary of Header Commands
Header commands specify something about the entire test file as a whole, instead of just a few lines inside the test.
ignore-XwhereXis an architecture, OS or stage will ignore the test accordinglyignore-prettywill not compile the pretty-printed test (this is done to test the pretty-printer, but might not always work)ignore-testalways ignores the testignore-lldbandignore-gdbwill skip the debuginfo testsmin-{gdb,lldb}-version