Skip to content

Commit d49c399

Browse files
committed
run-make: add some basic docs about the test suite's setup
1 parent 50297bb commit d49c399

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/run-make/README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# The `run-make` test suite
2+
3+
The `run-make` test suite contain 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.
7+
8+
## Infrastructure
9+
10+
The implementation for collecting and building the `rmake.rs` recipes (or
11+
`Makefile`s) are in
12+
[`src/tools/compiletest/src/runtest.rs`](https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/runtest.rs),
13+
in `run_rmake_v2_test` and `run_rmake_legacy_test`.
14+
15+
### Rust-based `run-make` tests: `rmake.rs`
16+
17+
The setup for the `rmake.rs` version is a 3-stage process:
18+
19+
1. First, we build the [`run_make_support`] library in bootstrap as a tool lib.
20+
2. Then, we compile the `rmake.rs` "recipe" linking the support library and its
21+
dependencies in, and provide a bunch of env vars. We setup a directory
22+
structure
23+
24+
```
25+
test_specific_build_dir/
26+
rmake.exe # recipe binary
27+
rmake_out/ # sources from test sources copied over
28+
```
29+
30+
and copy non-`rmake.rs` input support files over to `rmake_out/`. The
31+
support library is made available as an [*extern prelude*][extern_prelude].
32+
3. Finally, we run the recipe binary and set `rmake_out/` as the CWD.
33+
34+
[`run_make_support`]: https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
35+
[extern_prelude]: https://doc.rust-lang.org/reference/names/preludes.html#extern-prelude

0 commit comments

Comments
 (0)