Skip to content

Commit

Permalink
Rollup merge of rust-lang#72527 - RalfJung:miri-clippy-test-args, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

bootstrap: propagate test-args to miri and clippy test suites

For Miri I verified this works. For clippy, unfortunately it doesn't seem to work as a stage 0 tool:
```
./x.py --stage 0 test src/tools/clippy --test-args init
```
gives
```
   Compiling clippy-mini-macro-test v0.2.0 (/home/r/src/rust/rustc.3/src/tools/clippy/mini-macro)
error[E0658]: procedural macros cannot be expanded to expressions
  --> src/tools/clippy/mini-macro/src/lib.rs:11:5
   |
11 | /     quote!(
12 | |         #[allow(unused)]
13 | |         fn needless_take_by_value(s: String) {
14 | |             println!("{}", s.len());
...  |
24 | |         }
25 | |     )
   | |_____^
   |
   = note: see issue rust-lang#54727 <rust-lang#54727> for more information
   = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable

   Compiling proc-macro2 v1.0.3
   Compiling syn v1.0.11
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `clippy-mini-macro-test`.
```
But propagating `--test-args` to the test suite seems to make sense regardless.
Cc @rust-lang/clippy
  • Loading branch information
RalfJung committed May 24, 2020
2 parents 95c4583 + 7a121ad commit a75068a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ impl Step for Miri {
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
cargo.env("MIRI_PATH", miri);

cargo.arg("--").args(builder.config.cmd.test_args());

builder.add_rustc_lib_path(compiler, &mut cargo);

if !try_run(builder, &mut cargo.into()) {
Expand Down Expand Up @@ -545,6 +547,8 @@ impl Step for Clippy {
// clippy tests need to find the driver
cargo.env("CLIPPY_DRIVER_PATH", clippy);

cargo.arg("--").args(builder.config.cmd.test_args());

builder.add_rustc_lib_path(compiler, &mut cargo);

try_run(builder, &mut cargo.into());
Expand Down

0 comments on commit a75068a

Please sign in to comment.