@@ -63,7 +63,7 @@ The following test suites are available, with links for more information:
6363- [ ` codegen-units ` ] ( #codegen-units-tests ) — tests for codegen unit partitioning
6464- [ ` assembly ` ] ( #assembly-tests ) — verifies assembly output
6565- [ ` mir-opt ` ] ( #mir-opt-tests ) — tests for MIR generation
66- - [ ` run-make ` ] ( #run-make-tests ) — general purpose tests using a Makefile
66+ - [ ` run-make ` ] ( #run-make-tests ) — general purpose tests using Rust programs (or Makefile (legacy))
6767- ` run-make-fulldeps ` — ` run-make ` tests which require a linkable build of ` rustc ` ,
6868 or the rust demangler
6969- [ ` run-pass-valgrind ` ] ( #valgrind-tests ) — tests run with Valgrind
@@ -368,15 +368,43 @@ your test, causing separate files to be generated for 32bit and 64bit systems.
368368
369369### ` run-make ` tests
370370
371- The tests in [ ` tests/run-make ` ] are general-purpose tests using Makefiles
372- which provide the ultimate in flexibility.
373- These should be used as a last resort.
374- If possible, you should use one of the other test suites.
371+ > NOTE:
372+ > We are planning to migrate all existing Makefile-based ` run-make ` tests
373+ > to Rust recipes. You should not be adding new Makefile-based ` run-make `
374+ > tests.
375+
376+ The tests in [ ` tests/run-make ` ] are general-purpose tests using Rust * recipes* ,
377+ which are small programs allowing arbitrary Rust code such as ` rustc `
378+ invocations, and is supported by a [ ` run_make_support ` ] library. Using Rust
379+ recipes provide the ultimate in flexibility.
380+
381+ * These should be used as a last resort* . If possible, you should use one of the
382+ other test suites.
383+
375384If there is some minor feature missing which you need for your test,
376385consider extending compiletest to add a header command for what you need.
377386However, if running a bunch of commands is really what you need,
378387` run-make ` is here to the rescue!
379388
389+ #### Using Rust recipes
390+
391+ Each test should be in a separate directory with a ` rmake.rs ` Rust program,
392+ called the * recipe* . A recipe will be compiled and executed by compiletest
393+ with the ` run_make_support ` library linked in.
394+
395+ If you need new utilities or functionality, consider extending and improving
396+ the [ ` run_make_support ` ] library.
397+
398+ Two ` run-make ` tests are ported over to Rust recipes as examples:
399+
400+ - < https://github.com/rust-lang/rust/tree/master/tests/run-make/CURRENT_RUSTC_VERSION >
401+ - < https://github.com/rust-lang/rust/tree/master/tests/run-make/a-b-a-linker-guard >
402+
403+ #### Using Makefiles (legacy)
404+
405+ > NOTE:
406+ > You should avoid writing new Makefile-based ` run-make ` tests.
407+
380408Each test should be in a separate directory with a ` Makefile ` indicating the
381409commands to run.
382410There is a [ ` tools.mk ` ] Makefile which you can include which provides a bunch of
@@ -385,6 +413,7 @@ Take a look at some of the other tests for some examples on how to get started.
385413
386414[ `tools.mk` ] : https://github.com/rust-lang/rust/blob/master/tests/run-make/tools.mk
387415[ `tests/run-make` ] : https://github.com/rust-lang/rust/tree/master/tests/run-make
416+ [ `run_make_support` ] : https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
388417
389418
390419### Valgrind tests
0 commit comments