Skip to content

Commit b46a764

Browse files
authored
Merge pull request #2531 from Kivooeo/update-doc
Update documentation for current tests requirements
2 parents 9287205 + 24c403d commit b46a764

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/appendix/humorust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
What's a project without a sense of humor? And frankly some of these are
44
enlightening?
55

6-
- [Weird exprs test](https://github.com/rust-lang/rust/blob/master/tests/ui/weird-exprs.rs)
6+
- [Weird exprs test](https://github.com/rust-lang/rust/blob/master/tests/ui/expr/weird-exprs.rs)
77
- [Ferris Rap](https://fitzgen.com/2018/12/13/rust-raps.html)
88
- [The Genesis of Generic Germination](https://github.com/rust-lang/rust/pull/53645#issue-210543221)
99
- [The Bastion of the Turbofish test](https://github.com/rust-lang/rust/blob/79d8a0fcefa5134db2a94739b1d18daa01fc6e9f/src/test/ui/bastion-of-the-turbofish.rs)

src/tests/directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ described below:
359359
- Example: `x86_64-unknown-linux-gnu`
360360

361361
See
362-
[`tests/ui/commandline-argfile.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui/argfile/commandline-argfile.rs)
362+
[`tests/ui/argfile/commandline-argfile.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui/argfile/commandline-argfile.rs)
363363
for an example of a test that uses this substitution.
364364

365365
[output normalization]: ui.md#normalization

src/tests/ui.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ If you need to work with `#![no_std]` cross-compiling tests, consult the
2525

2626
## General structure of a test
2727

28-
A test consists of a Rust source file located anywhere in the `tests/ui`
29-
directory, but they should be placed in a suitable sub-directory. For example,
30-
[`tests/ui/hello.rs`] is a basic hello-world test.
28+
A test consists of a Rust source file located in the `tests/ui` directory.
29+
**Tests must be placed in the appropriate subdirectory** based on their purpose
30+
and testing category - placing tests directly in `tests/ui` is not permitted.
3131

3232
Compiletest will use `rustc` to compile the test, and compare the output against
3333
the expected output which is stored in a `.stdout` or `.stderr` file located
@@ -46,8 +46,6 @@ pass/fail expectations](#controlling-passfail-expectations).
4646
By default, a test is built as an executable binary. If you need a different
4747
crate type, you can use the `#![crate_type]` attribute to set it as needed.
4848

49-
[`tests/ui/hello.rs`]: https://github.com/rust-lang/rust/blob/master/tests/ui/hello.rs
50-
5149
## Output comparison
5250

5351
UI tests store the expected output from the compiler in `.stderr` and `.stdout`

0 commit comments

Comments
 (0)