Skip to content

Commit 572eaa6

Browse files
committed
cleaned up some stragglers
1 parent 8751dfe commit 572eaa6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/compiletest.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ representing tests that should succeed, `run-fail`, a folder holding tests that
1414
a failure (non-zero status), `compile-fail`, a folder holding tests that should fail to compile, and many more. The various
1515
suites are defined in [src/tools/compiletest/src/common.rs](https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/common.rs) in the `pub struct Config` declaration. And a very good
1616
introduction to the different suites of compiler tests along with details about them can be found
17-
[here, at Brian Anderson's blog](https://brson.github.io/2017/07/10/how-rust-is-tested#s-ct).
17+
in [`Adding new tests`](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/adding.md).
1818

1919
## Adding a new test file
2020
Briefly, simply create your new test in the appropriate location under [src/test](https://github.com/rust-lang/rust/tree/master/src/test). No registration of test files is necessary as
@@ -25,14 +25,11 @@ See [`Adding new tests`](https://github.com/rust-lang-nursery/rustc-guide/blob/m
2525
Source file annotations which appear in comments near the top of the source file *before* any test code are known as header
2626
commands. These commands can instruct `compiletest` to ignore this test, set expectations on whether it is expected to
2727
succeed at compiling, or what the test's return code is expected to be. Header commands (and their inline counterparts,
28-
Error Info commands) are described more fully
29-
[here](https://github.com/rust-lang/rust/blob/master/src/test/COMPILER_TESTS.md).
28+
Error Info commands) are described more fully [here](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/adding.md#header-commands-configuring-rustc).
3029

3130
### Adding a new header command
32-
Header commands are defined in [src/tools/compiletest/src/header.rs](https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/header.rs). At a high level, dozens of test properties are defined
33-
in the `TestProps` struct. These are all set to default values in the struct's `impl` block and any test can override this
34-
default value by specifying the property as header command as a comment (`//`) in the test source file, before any source
35-
code.
31+
Header commands are defined in the `TestProps` struct in [src/tools/compiletest/src/header.rs](https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/header.rs). At a high level, there are dozens of test properties are defined here, all set to default values in the `TestProp` struct's `impl` block. Any test can override this
32+
default value by specifying the property in question as header command as a comment (`//`) in the test source file, before any source code.
3633

3734
#### Using a header command
3835
Here is an example, specifying the `must-compile-successfully` header command, which takes no arguments, followed by the
@@ -140,7 +137,7 @@ is that `compiletest` expects the failure code defined by the header command inv
140137
value.
141138

142139
Although specific to `failure-status` (as every header command will have a different implementation in order to invoke
143-
behavior change) perhaps it is helpful to see the behavior hange implementation of one case, simply as an example. To implement `failure-status`, the `check_correct_failure_status()` function found in the `TestCx` implementation block,
140+
behavior change) perhaps it is helpful to see the behavior change implementation of one case, simply as an example. To implement `failure-status`, the `check_correct_failure_status()` function found in the `TestCx` implementation block,
144141
located in [src/tools/compiletest/src/runtest.rs](https://github.com/rust-lang/rust/tree/master/src/tools/compiletest/src/runtest.rs), was modified as per below:
145142
```diff
146143
@@ -295,11 +295,14 @@ impl<'test> TestCx<'test> {

0 commit comments

Comments
 (0)