@@ -63,7 +63,8 @@ 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
67+ Makefiles (legacy))
6768- ` run-make-fulldeps ` — ` run-make ` tests which require a linkable build of ` rustc ` ,
6869 or the rust demangler
6970- [ ` run-pass-valgrind ` ] ( #valgrind-tests ) — tests run with Valgrind
@@ -368,15 +369,43 @@ your test, causing separate files to be generated for 32bit and 64bit systems.
368369
369370### ` run-make ` tests
370371
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.
372+ > NOTE:
373+ > We are planning to migrate all existing Makefile-based ` run-make ` tests
374+ > to Rust recipes. You should not be adding new Makefile-based ` run-make `
375+ > tests.
376+
377+ The tests in [ ` tests/run-make ` ] are general-purpose tests using Rust * recipes* ,
378+ which are small programs allowing arbitrary Rust code such as ` rustc `
379+ invocations, and is supported by a [ ` run_make_support ` ] library. Using Rust
380+ recipes provide the ultimate in flexibility.
381+
382+ * These should be used as a last resort* . If possible, you should use one of the
383+ other test suites.
384+
375385If there is some minor feature missing which you need for your test,
376386consider extending compiletest to add a header command for what you need.
377387However, if running a bunch of commands is really what you need,
378388` run-make ` is here to the rescue!
379389
390+ #### Using Rust recipes
391+
392+ Each test should be in a separate directory with a ` rmake.rs ` Rust program,
393+ called the * recipe* . A recipe will be compiled and executed by compiletest
394+ with the ` run_make_support ` library linked in.
395+
396+ If you need new utilities or functionality, consider extending and improving
397+ the [ ` run_make_support ` ] library.
398+
399+ Two ` run-make ` tests are ported over to Rust recipes as examples:
400+
401+ - < https://github.com/rust-lang/rust/tree/master/tests/run-make/CURRENT_RUSTC_VERSION >
402+ - < https://github.com/rust-lang/rust/tree/master/tests/run-make/a-b-a-linker-guard >
403+
404+ #### Using Makefiles (legacy)
405+
406+ > NOTE:
407+ > You should avoid writing new Makefile-based ` run-make ` tests.
408+
380409Each test should be in a separate directory with a ` Makefile ` indicating the
381410commands to run.
382411There is a [ ` tools.mk ` ] Makefile which you can include which provides a bunch of
@@ -385,6 +414,7 @@ Take a look at some of the other tests for some examples on how to get started.
385414
386415[ `tools.mk` ] : https://github.com/rust-lang/rust/blob/master/tests/run-make/tools.mk
387416[ `tests/run-make` ] : https://github.com/rust-lang/rust/tree/master/tests/run-make
417+ [ `run_make_support` ] : https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
388418
389419
390420### Valgrind tests
0 commit comments