diff options
| author | Ralf Jung <post@ralfj.de> | 2024-02-24 18:26:07 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-02-24 18:27:38 +0100 |
| commit | cd36cda60c99cc17183a206c93713c375838af81 (patch) | |
| tree | f70ed1d804770578dbad92e2f7dfabef81714449 | |
| parent | 40dc2b4bd2dfe7a9f03cec85657425d2746d4f50 (diff) | |
| download | rust-cd36cda60c99cc17183a206c93713c375838af81.tar.gz rust-cd36cda60c99cc17183a206c93713c375838af81.zip | |
compiletest: call cargo-miri directly rather than via 'cargo run'
| -rw-r--r-- | src/tools/miri/tests/compiletest.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs index 8bed321e655..d8f7cafe3b2 100644 --- a/src/tools/miri/tests/compiletest.rs +++ b/src/tools/miri/tests/compiletest.rs @@ -99,18 +99,15 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) -> }; if with_dependencies { + // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary. + // (It's a separate crate, so we don't get an env var from cargo.) + let mut prog = miri_path(); + prog.set_file_name("cargo-miri"); + config.dependency_builder.program = prog; + let builder_args = ["miri", "run"]; // There is no `cargo miri build` so we just use `cargo miri run`. + config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect(); config.dependencies_crate_manifest_path = Some(Path::new("test_dependencies").join("Cargo.toml")); - let mut builder_args = vec!["run".into()]; - builder_args.extend(flagsplit(&env::var("CARGO_EXTRA_FLAGS").unwrap_or_default())); - builder_args.extend([ - "--manifest-path".into(), - "cargo-miri/Cargo.toml".into(), - "--".into(), - "miri".into(), - "run".into(), // There is no `cargo miri build` so we just use `cargo miri run`. - ]); - config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect(); // Reset `RUSTFLAGS` to work around <https://github.com/rust-lang/rust/pull/119574#issuecomment-1876878344>. config.dependency_builder.envs.push(("RUSTFLAGS".into(), None)); } |
