Skip to content

Commit d4ec987

Browse files
Change src/test to tests (rust-lang#1547)
1 parent 03902fe commit d4ec987

20 files changed

+110
-110
lines changed

src/appendix/humorust.md

+1-1
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/src/test/ui/weird-exprs.rs)
6+
- [Weird exprs test](https://github.com/rust-lang/rust/blob/master/tests/ui/weird-exprs.rs)
77
- [Ferris Rap](http://fitzgeraldnick.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/asm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ can't know ahead of time whether a function will require a frame/base pointer.
361361

362362
Various tests for inline assembly are available:
363363

364-
- `src/test/assembly/asm`
365-
- `src/test/ui/asm`
366-
- `src/test/codegen/asm-*`
364+
- `tests/assembly/asm`
365+
- `tests/ui/asm`
366+
- `tests/codegen/asm-*`
367367

368368
Every architecture supported by inline assembly must have exhaustive tests in
369-
`src/test/assembly/asm` which test all combinations of register classes and types.
369+
`tests/assembly/asm` which test all combinations of register classes and types.

src/building/bootstrapping.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ Build artifacts include, but are not limited to:
193193
without building `rustc` from source ('build with stage 0, then test the
194194
artifacts'). If you're working on the standard library, this is normally the
195195
test command you want.
196-
- `./x.py test src/test/ui` means to build the stage 1 compiler and run
196+
- `./x.py test tests/ui` means to build the stage 1 compiler and run
197197
`compiletest` on it. If you're working on the compiler, this is normally the
198198
test command you want.
199199

200200
#### Examples of what *not* to do
201201

202-
- `./x.py test --stage 0 src/test/ui` is not useful: it runs tests on the
203-
_beta_ compiler and doesn't build `rustc` from source. Use `test src/test/ui`
202+
- `./x.py test --stage 0 tests/ui` is not useful: it runs tests on the
203+
_beta_ compiler and doesn't build `rustc` from source. Use `test tests/ui`
204204
instead, which builds stage 1 from source.
205205
- `./x.py test --stage 0 compiler/rustc` builds the compiler but runs no tests:
206206
it's running `cargo test -p rustc`, but cargo doesn't understand Rust's
@@ -386,7 +386,7 @@ recompiling all dependencies.
386386
`CARGOFLAGS` will pass arguments to cargo itself (e.g. `--timings`). `CARGOFLAGS_BOOTSTRAP` and
387387
`CARGOFLAGS_NOT_BOOTSTRAP` work analogously to `RUSTFLAGS_BOOTSTRAP`.
388388

389-
`--test-args` will pass arguments through to the test runner. For `src/test/ui`, this is
389+
`--test-args` will pass arguments through to the test runner. For `tests/ui`, this is
390390
compiletest; for unit tests and doctests this is the `libtest` runner. Most test runner accept
391391
`--help`, which you can use to find out the options accepted by the runner.
392392

src/building/how-to-build-and-run.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ in other sections:
223223
- Running tests (see the [section on running tests](../tests/running.html) for
224224
more details):
225225
- `./x.py test library/std` – runs the unit tests and integration tests from `std`
226-
- `./x.py test src/test/ui` – runs the `ui` test suite
227-
- `./x.py test src/test/ui/const-generics` - runs all the tests in
226+
- `./x.py test tests/ui` – runs the `ui` test suite
227+
- `./x.py test tests/ui/const-generics` - runs all the tests in
228228
the `const-generics/` subdirectory of the `ui` test suite
229-
- `./x.py test src/test/ui/const-generics/const-types.rs` - runs
229+
- `./x.py test tests/ui/const-generics/const-types.rs` - runs
230230
the single test `const-types.rs` from the `ui` test suite
231231

232232
### Cleaning out build directories

src/building/suggested.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ rebuild. That ought to fix the problem.
172172

173173
You can also use `--keep-stage 1` when running tests. Something like this:
174174

175-
- Initial test run: `./x.py test src/test/ui`
176-
- Subsequent test run: `./x.py test src/test/ui --keep-stage 1`
175+
- Initial test run: `./x.py test tests/ui`
176+
- Subsequent test run: `./x.py test tests/ui --keep-stage 1`
177177

178178
## Fine-tuning optimizations
179179

src/compiler-src.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ You can read more about rustdoc in [this chapter][rustdocch].
147147

148148
## Tests
149149

150-
The test suite for all of the above is in [`src/test/`]. You can read more
150+
The test suite for all of the above is in [`tests/`]. You can read more
151151
about the test suite [in this chapter][testsch].
152152

153153
The test harness itself is in [`src/tools/compiletest`].
154154

155155
[testsch]: ./tests/intro.md
156156

157-
[`src/test/`]: https://github.com/rust-lang/rust/tree/master/src/test
157+
[`tests/`]: https://github.com/rust-lang/rust/tree/master/tests
158158
[`src/tools/compiletest`]: https://github.com/rust-lang/rust/tree/master/src/tools/compiletest
159159

160160
## Build System

src/incrcomp-debugging.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ There are various ways to write tests against the dependency graph.
66
The simplest mechanisms are the `#[rustc_if_this_changed]` and
77
`#[rustc_then_this_would_need]` annotations. These are used in ui tests
88
to test whether the expected set of paths exist in the dependency graph.
9-
As an example, see `src/test/ui/dep-graph/dep-graph-caller-callee.rs`.
9+
As an example, see `tests/ui/dep-graph/dep-graph-caller-callee.rs`.
1010

1111
The idea is that you can annotate a test like:
1212

src/llvm-coverage-instrumentation.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,15 @@ Expected results for both the `mir-opt` tests and the `coverage*` tests under
297297

298298
```shell
299299
$ ./x.py test mir-opt --bless
300-
$ ./x.py test src/test/run-make-fulldeps/coverage --bless
300+
$ ./x.py test tests/run-make-fulldeps/coverage --bless
301301
```
302302

303-
[mir-opt-test]: https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/instrument_coverage.rs
304-
[coverage-test-samples]: https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/coverage
305-
[`coverage-reports`]: https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/coverage-reports
306-
[`coverage-spanview`]: https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/coverage-spanview
303+
[mir-opt-test]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/instrument_coverage.rs
304+
[coverage-test-samples]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps/coverage
305+
[`coverage-reports`]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps/coverage-reports
306+
[`coverage-spanview`]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps/coverage-spanview
307307
[spanview-debugging]: compiler-debugging.md#viewing-spanview-output
308-
[`coverage-llvmir`]: https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/coverage-llvmir
308+
[`coverage-llvmir`]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps/coverage-llvmir
309309

310310
## Implementation Details of the `InstrumentCoverage` MIR Pass
311311

src/mir/optimizations.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ optimizes it, and returns the improved MIR.
2828

2929
## Quickstart for adding a new optimization
3030

31-
1. Make a Rust source file in `src/test/mir-opt` that shows the code you want to
31+
1. Make a Rust source file in `tests/mir-opt` that shows the code you want to
3232
optimize. This should be kept simple, so avoid `println!` or other formatting
3333
code if it's not necessary for the optimization. The reason for this is that
3434
`println!`, `format!`, etc. generate a lot of MIR that can make it harder to
3535
understand what the optimization does to the test.
3636

37-
2. Run `./x.py test --bless src/test/mir-opt/<your-test>.rs` to generate a MIR
37+
2. Run `./x.py test --bless tests/mir-opt/<your-test>.rs` to generate a MIR
3838
dump. Read [this README][mir-opt-test-readme] for instructions on how to dump
3939
things.
4040

@@ -51,10 +51,10 @@ optimizes it, and returns the improved MIR.
5151
[`run_optimization_passes()`] function,
5252
3. and then start modifying the copied optimization.
5353

54-
5. Rerun `./x.py test --bless src/test/mir-opt/<your-test>.rs` to regenerate the
54+
5. Rerun `./x.py test --bless tests/mir-opt/<your-test>.rs` to regenerate the
5555
MIR dumps. Look at the diffs to see if they are what you expect.
5656

57-
6. Run `./x.py test src/test/ui` to see if your optimization broke anything.
57+
6. Run `./x.py test tests/ui` to see if your optimization broke anything.
5858

5959
7. If there are issues with your optimization, experiment with it a bit and
6060
repeat steps 5 and 6.
@@ -70,7 +70,7 @@ optimizes it, and returns the improved MIR.
7070
If you have any questions along the way, feel free to ask in
7171
`#t-compiler/wg-mir-opt` on Zulip.
7272

73-
[mir-opt-test-readme]: https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/README.md
73+
[mir-opt-test-readme]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/README.md
7474
[`compiler/rustc_mir_transform/src`]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_mir_transform/src
7575
<!--- TODO: Change NoLandingPads. [#1232](https://github.com/rust-lang/rustc-dev-guide/issues/1232) -->
7676
[`no_landing_pads`]: https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/no_landing_pads.rs

src/profile-guided-optimization.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ in [run-make tests][rmake-tests] (the relevant tests have `pgo` in their name).
131131
There is also a [codegen test][codegen-test] that checks that some expected
132132
instrumentation artifacts show up in LLVM IR.
133133

134-
[rmake-tests]: https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps
135-
[codegen-test]: https://github.com/rust-lang/rust/blob/master/src/test/codegen/pgo-instrumentation.rs
134+
[rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps
135+
[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs
136136

137137
## Additional Information
138138

src/rustdoc-internals.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Some extra reading about `make_test` can be found
191191

192192
So that's rustdoc's code in a nutshell, but there's more things in the repo
193193
that deal with it. Since we have the full `compiletest` suite at hand, there's
194-
a set of tests in `src/test/rustdoc` that make sure the final HTML is what we
194+
a set of tests in `tests/rustdoc` that make sure the final HTML is what we
195195
expect in various situations. These tests also use a supplementary script,
196196
`src/etc/htmldocck.py`, that allows it to look through the final HTML using
197197
XPath notation to get a precise look at the output. The full description of all
@@ -204,7 +204,7 @@ directory relative to the test file with the comment. If you need to build
204204
docs for the auxiliary file, use `// build-aux-docs`.
205205

206206
In addition, there are separate tests for the search index and rustdoc's
207-
ability to query it. The files in `src/test/rustdoc-js` each contain a
207+
ability to query it. The files in `tests/rustdoc-js` each contain a
208208
different search query and the expected results, broken out by search tab.
209209
These files are processed by a script in `src/tools/rustdoc-js` and the Node.js
210210
runtime. These tests don't have as thorough of a writeup, but a broad example

src/rustdoc.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
5656
* If you want to copy those docs to a webserver, copy all of
5757
`build/host/doc`, since that's where the CSS, JS, fonts, and landing
5858
page are.
59-
* Use `./x.py test src/test/rustdoc*` to run the tests using a stage1
59+
* Use `./x.py test tests/rustdoc*` to run the tests using a stage1
6060
rustdoc.
6161
* See [Rustdoc internals] for more information about tests.
6262

@@ -72,13 +72,13 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
7272
`doctest.rs`.
7373
* The Markdown renderer is loaded up in `html/markdown.rs`, including functions
7474
for extracting doctests from a given block of Markdown.
75-
* The tests on the structure of rustdoc HTML output are located in `src/test/rustdoc`, where
75+
* The tests on the structure of rustdoc HTML output are located in `tests/rustdoc`, where
7676
they're handled by the test runner of rustbuild and the supplementary script
7777
`src/etc/htmldocck.py`.
7878

7979
## Tests
8080

81-
* All paths in this section are relative to `src/test` in the rust-lang/rust repository.
81+
* All paths in this section are relative to `tests` in the rust-lang/rust repository.
8282
* Tests on search index generation are located in `rustdoc-js`, as a
8383
series of JavaScript files that encode queries on the standard library search
8484
index and expected results.

src/sanitizers.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ implementation:
7676
## Testing sanitizers
7777

7878
Sanitizers are validated by code generation tests in
79-
[`src/test/codegen/sanitize*.rs`][test-cg] and end-to-end functional tests in
80-
[`src/test/ui/sanitize/`][test-ui] directory.
79+
[`tests/codegen/sanitize*.rs`][test-cg] and end-to-end functional tests in
80+
[`tests/ui/sanitize/`][test-ui] directory.
8181

8282
Testing sanitizer functionality requires the sanitizer runtimes (built when
8383
`sanitizer = true` in `config.toml`) and target providing support for particular
8484
sanitizer. When sanitizer is unsupported on given target, sanitizers tests will
8585
be ignored. This behaviour is controlled by compiletest `needs-sanitizer-*`
8686
directives.
8787

88-
[test-cg]: https://github.com/rust-lang/rust/tree/master/src/test/codegen
89-
[test-ui]: https://github.com/rust-lang/rust/tree/master/src/test/ui/sanitize
88+
[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen
89+
[test-ui]: https://github.com/rust-lang/rust/tree/master/tests/ui/sanitize
9090

9191
## Enabling sanitizer on a new target
9292

@@ -98,7 +98,7 @@ To enable a sanitizer on a new target which is already supported by LLVM:
9898
2. [Build the runtime for the target and include it in the libdir.][sanitizer-targets]
9999
3. [Teach compiletest that your target now supports the sanitizer.][compiletest-definition]
100100
Tests marked with `needs-sanitizer-*` should now run on the target.
101-
4. Run tests `./x.py test --force-rerun src/test/ui/sanitize/` to verify.
101+
4. Run tests `./x.py test --force-rerun tests/ui/sanitize/` to verify.
102102
5. [--enable-sanitizers in the CI configuration][ci-configuration] to build and
103103
distribute the sanitizer runtime as part of the release process.
104104

src/tests/adding.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This will depend on the nature of the change and what you want to exercise.
1212
Here are some rough guidelines:
1313

1414
- The majority of compiler tests are done with [compiletest].
15-
- The majority of compiletest tests are [UI](ui.md) tests in the [`src/test/ui`] directory.
15+
- The majority of compiletest tests are [UI](ui.md) tests in the [`tests/ui`] directory.
1616
- Changes to the standard library are usually tested within the standard library itself.
1717
- The majority of standard library tests are written as doctests,
1818
which illustrate and exercise typical API behavior.
@@ -30,7 +30,7 @@ Here are some rough guidelines:
3030
- Check out the [compiletest] chapter for more specialized test suites.
3131

3232
[compiletest]: compiletest.md
33-
[`src/test/ui`]: https://github.com/rust-lang/rust/tree/master/src/test/ui/
33+
[`tests/ui`]: https://github.com/rust-lang/rust/tree/master/tests/ui/
3434

3535
## UI test walkthrough
3636

@@ -41,13 +41,13 @@ For this tutorial, we'll be adding a test for an async error message.
4141
### Step 1. Add a test file
4242

4343
The first step is to create a Rust source file somewhere in the
44-
[`src/test/ui`] tree.
44+
[`tests/ui`] tree.
4545
When creating a test, do your best to find a good location and name (see [Test
4646
organization](ui.md#test-organization) for more).
4747
Since naming is the hardest part of development, everything should be downhill
4848
from here!
4949

50-
Let's place our async test at `src/test/ui/async-await/await-without-async.rs`:
50+
Let's place our async test at `tests/ui/async-await/await-without-async.rs`:
5151

5252
```rust,ignore
5353
// Check what happens when using await in a non-async fn.
@@ -84,17 +84,17 @@ The next step is to create the expected output from the compiler.
8484
This can be done with the `--bless` option:
8585

8686
```sh
87-
./x.py test src/test/ui/async-await/await-without-async.rs --bless
87+
./x.py test tests/ui/async-await/await-without-async.rs --bless
8888
```
8989

9090
This will build the compiler (if it hasn't already been built), compile the
9191
test, and place the output of the compiler in a file called
92-
`src/test/ui/async-await/await-without-async.stderr`.
92+
`tests/ui/async-await/await-without-async.stderr`.
9393

9494
However, this step will fail!
9595
You should see an error message, something like this:
9696

97-
> error: /rust/src/test/ui/async-await/await-without-async.rs:7: unexpected
97+
> error: /rust/tests/ui/async-await/await-without-async.rs:7: unexpected
9898
> error: '7:10: 7:16: `await` is only allowed inside `async` functions and
9999
> blocks E0728'
100100
@@ -118,7 +118,7 @@ annotations](ui.md#error-annotations) section).
118118
Save that, and run the test again:
119119

120120
```sh
121-
./x.py test src/test/ui/async-await/await-without-async.rs
121+
./x.py test tests/ui/async-await/await-without-async.rs
122122
```
123123

124124
It should now pass, yay!
@@ -131,7 +131,7 @@ If you are adding a new diagnostic message, now would be a good time to
131131
also consider how readable the message looks overall, particularly for
132132
people new to Rust.
133133

134-
Our example `src/test/ui/async-await/await-without-async.stderr` file should
134+
Our example `tests/ui/async-await/await-without-async.stderr` file should
135135
look like this:
136136

137137
```text
@@ -166,7 +166,7 @@ The final step before posting a PR is to check if you have affected anything els
166166
Running the UI suite is usually a good start:
167167

168168
```sh
169-
./x.py test src/test/ui
169+
./x.py test tests/ui
170170
```
171171

172172
If other tests start failing, you may need to investigate what has changed

0 commit comments

Comments
 (0)