You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/compiletest.md
+5-6
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,27 @@ configure behavior and expected results of both individual and groups of tests.
7
7
`compiletest` tests may check test code for success, for failure or in some cases, even failure to compile. Tests are
8
8
typically organized as a Rust source file with annotations in comments before and/or within the test code, which serve to
9
9
direct `compiletest` on if or how to run the test, what behavior to expect, and more. If you are unfamiliar with the compiler
10
-
testing framework, see [`this chapter`](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/intro.md) for additional background.
10
+
testing framework, see [`this chapter`](./tests/intro.html) for additional background.
11
11
12
12
The tests themselves are typically (but not always) organized into "suites"--for example, `run-pass`, a folder
13
13
representing tests that should succeed, `run-fail`, a folder holding tests that should compile successfully, but return
14
14
a failure (non-zero status), `compile-fail`, a folder holding tests that should fail to compile, and many more. The various
15
15
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
16
-
introduction to the different suites of compiler tests along with details about them can be found
17
-
in [`Adding new tests`](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/adding.md).
16
+
introduction to the different suites of compiler tests along with details about them can be found in [`Adding new tests`](./tests/adding.html).
18
17
19
18
## Adding a new test file
20
19
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
21
20
`compiletest` will scan the [src/test](https://github.com/rust-lang/rust/tree/master/src/test) subfolder recursively, and will execute any Rust source files it finds as tests.
22
-
See [`Adding new tests`](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/adding.md) for a complete guide on how to adding new tests.
21
+
See [`Adding new tests`](./tests/adding.html) for a complete guide on how to adding new tests.
23
22
24
23
## Header Commands
25
24
Source file annotations which appear in comments near the top of the source file *before* any test code are known as header
26
25
commands. These commands can instruct `compiletest` to ignore this test, set expectations on whether it is expected to
27
26
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 [here](https://github.com/rust-lang-nursery/rustc-guide/blob/master/src/tests/adding.md#header-commands-configuring-rustc).
27
+
Error Info commands) are described more fully [here](./tests/adding.html#header-commands-configuring-rustc).
29
28
30
29
### Adding a new header command
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
30
+
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 defined here, all set to default values in the `TestProp` struct's `impl` block. Any test can override this
32
31
default value by specifying the property in question as header command as a comment (`//`) in the test source file, before any source code.
0 commit comments