Skip to content

Commit 88def17

Browse files
committed
run-make: update test suite README
1 parent 83c6654 commit 88def17

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

tests/run-make/README.md

+7-29
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,26 @@
11
# The `run-make` test suite
22

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.
74

85
## Infrastructure
96

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).
118

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`.
1610

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:
2512

2613
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/`
3015

3116
```
3217
<test-name>/
3318
rmake.exe # recipe binary
3419
rmake_out/ # sources from test sources copied over
3520
```
3621

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.
4124

4225
[`run_make_support`]: ../../src/tools/run-make-support
4326
[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

Comments
 (0)