Skip to content

Commit f710aae

Browse files
committed
Auto merge of #28366 - christopherdumas:beginners_manuel, r=steveklabnik
This is something that I wish I had when I started contributing to Rust (not that long ago :). I plan on writing a manual for bors and the rust testing setup too, if there isn't one already.
2 parents 50a6c79 + d09ba5d commit f710aae

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

COMPILER_TESTS.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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`

CONTRIBUTING.md

+24
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ links to the major sections:
1010
* [Writing Documentation](#writing-documentation)
1111
* [Issue Triage](#issue-triage)
1212
* [Out-of-tree Contributions](#out-of-tree-contributions)
13+
* [Helpful Links and Information](#helpful-links-and-information)
1314

1415
If you have questions, please make a post on [internals.rust-lang.org][internals] or
1516
hop on [#rust-internals][pound-rust-internals].
@@ -210,3 +211,26 @@ valuable!
210211
[users]: https://users.rust-lang.org/
211212
[so]: http://stackoverflow.com/questions/tagged/rust
212213
[community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library
214+
215+
## Helpful Links and Information
216+
217+
For people new to Rust, and just starting to contribute, or even for
218+
more seasoned developers, some useful places to look for information
219+
are:
220+
221+
* The [Rust Internals forum][rif], a place to ask questions and
222+
discuss Rust's internals
223+
* The [generated documentation for rust's compiler][gdfrustc]
224+
* The [rust referance][rr], even though it doesn't specifically talk about Rust's internals, its a great reasource nontheless
225+
* Although out of date, [Tom Lee's great blog article][tlgba] is very helpful
226+
* [rustaceans.org][ro] is helpful, but mostly dedicated to IRC
227+
* The [Rust Compiler Testing Docs][rctd]
228+
* **Google**!
229+
* Don't be afraid to ask! The Rust community is friendly and helpful.
230+
231+
[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/
232+
[rif]: http://internals.rust-lang.org
233+
[rr]: https://doc.rust-lang.org/book/README.html
234+
[tlgba]: http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/
235+
[ro]: http://www.rustaceans.org/
236+
[rctd]: ./COMPILER_TESTS.md

0 commit comments

Comments
 (0)