|
1 | 1 | # The `run-make` test suite
|
2 | 2 |
|
3 |
| -The `run-make` test suite contains tests which are the most flexible out of all |
4 |
| -the [rust-lang/rust](https://github.com/rust-lang/rust) test suites. `run-make` |
5 |
| -tests can basically contain arbitrary code, and are supported by the |
6 |
| -[`run_make_support`] library. |
| 3 | +The `run-make` test suite contains tests which are the most flexible out of all the [rust-lang/rust](https://github.com/rust-lang/rust) test suites. `run-make` tests can basically contain arbitrary code, and are supported by the [`run_make_support`] library. |
7 | 4 |
|
8 | 5 | ## Infrastructure
|
9 | 6 |
|
10 |
| -There are two kinds of run-make tests: |
| 7 | +A `run-make` test is a test recipe source file `rmake.rs` accompanied by its parent directory (e.g. `tests/run-make/foo/rmake.rs` is the `foo` `run-make` test). |
11 | 8 |
|
12 |
| -1. The new `rmake.rs` version: this allows run-make tests to be written in Rust |
13 |
| - (with `rmake.rs` as the main test file). |
14 |
| -2. The legacy `Makefile` version: this is what run-make tests were written with |
15 |
| - before support for `rmake.rs` was introduced. |
| 9 | +The implementation for collecting and building the `rmake.rs` recipes are in [`src/tools/compiletest/src/runtest.rs`](../../src/tools/compiletest/src/runtest.rs), in `run_rmake_v2_test` and `run_rmake_legacy_test`. |
16 | 10 |
|
17 |
| -The implementation for collecting and building the `rmake.rs` recipes (or |
18 |
| -`Makefile`s) are in |
19 |
| -[`src/tools/compiletest/src/runtest.rs`](../../src/tools/compiletest/src/runtest.rs), |
20 |
| -in `run_rmake_v2_test` and `run_rmake_legacy_test`. |
21 |
| - |
22 |
| -### Rust-based `run-make` tests: `rmake.rs` |
23 |
| - |
24 |
| -The setup for the `rmake.rs` version is a 3-stage process: |
| 11 | +The setup for the `rmake.rs` can be summarized as a 3-stage process: |
25 | 12 |
|
26 | 13 | 1. First, we build the [`run_make_support`] library in bootstrap as a tool lib.
|
27 |
| -2. Then, we compile the `rmake.rs` "recipe" linking the support library and its |
28 |
| - dependencies in, and provide a bunch of env vars. We setup a directory |
29 |
| - structure within `build/<target>/test/run-make/` |
| 14 | +2. Then, we compile the `rmake.rs` "recipe" linking the support library and its dependencies in, and provide a bunch of env vars. We setup a directory structure within `build/<target>/test/run-make/` |
30 | 15 |
|
31 | 16 | ```
|
32 | 17 | <test-name>/
|
33 | 18 | rmake.exe # recipe binary
|
34 | 19 | rmake_out/ # sources from test sources copied over
|
35 | 20 | ```
|
36 | 21 |
|
37 |
| - and copy non-`rmake.rs` input support files over to `rmake_out/`. The |
38 |
| - support library is made available as an [*extern prelude*][extern_prelude]. |
39 |
| -3. Finally, we run the recipe binary and set `rmake_out/` as the working |
40 |
| - directory. |
| 22 | + and copy non-`rmake.rs` input support files over to `rmake_out/`. The support library is made available as an [*extern prelude*][extern_prelude]. |
| 23 | +3. Finally, we run the recipe binary and set `rmake_out/` as the working directory. |
41 | 24 |
|
42 | 25 | [`run_make_support`]: ../../src/tools/run-make-support
|
43 | 26 | [extern_prelude]: https://doc.rust-lang.org/reference/names/preludes.html#extern-prelude
|
44 |
| - |
45 |
| -### Formatting |
46 |
| - |
47 |
| -Note that files under `tests/` are not formatted by `./x fmt`, |
48 |
| -use `rustfmt tests/path/to/file.rs` to format a specific file if desired. |
0 commit comments