Skip to content

Commit 2323ecb

Browse files
committed
Auto merge of rust-lang#2969 - oli-obk:run-dep, r=RalfJung
Stop parsing ui_test annotations in `run-dep` mode fixes rust-lang#2967
2 parents fa6cf3f + c6f5b5f commit 2323ecb

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/tools/miri/Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,9 @@ dependencies = [
842842

843843
[[package]]
844844
name = "ui_test"
845-
version = "0.11.6"
845+
version = "0.11.7"
846846
source = "registry+https://github.com/rust-lang/crates.io-index"
847-
checksum = "24a2e70adc9d18b9b4dd80ea57aeec447103c6fbb354a07c080adad451c645e1"
847+
checksum = "c21899b59f53717dfad29e4f46e5b21a200a1b6888ab86532a07cfc8b48dd78c"
848848
dependencies = [
849849
"bstr",
850850
"cargo-platform",

src/tools/miri/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libloading = "0.7"
3636

3737
[dev-dependencies]
3838
colored = "2"
39-
ui_test = "0.11.6"
39+
ui_test = "0.11.7"
4040
rustc_version = "0.4"
4141
# Features chosen to match those required by env_logger, to avoid rebuilds
4242
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }

src/tools/miri/miri

+1
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ run|run-dep)
325325
MIRIFLAGS="$MIRIFLAGS --target $MIRI_TEST_TARGET"
326326
fi
327327

328+
CARGO="$CARGO --quiet"
328329
# First build and get a sysroot.
329330
$CARGO build $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml
330331
find_sysroot

src/tools/miri/tests/compiletest.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ fn main() -> Result<()> {
275275
fn run_dep_mode(target: String, mut args: impl Iterator<Item = OsString>) -> Result<()> {
276276
let path = args.next().expect("./miri run-dep must be followed by a file name");
277277
let mut config = test_config(&target, "", Mode::Yolo, /* with dependencies */ true);
278-
config.program.args.remove(0); // remove the `--error-format=json` argument
279-
config.program.args.push("--color".into());
280-
config.program.args.push("always".into());
281-
let mut cmd = ui_test::test_command(config, Path::new(&path))?;
282-
// Separate the arguments to the `cargo miri` invocation from
283-
// the arguments to the interpreted prog
284-
cmd.arg("--");
278+
config.program.args.clear(); // We want to give the user full control over flags
279+
config.build_dependencies_and_link_them()?;
280+
281+
let mut cmd = config.program.build(&config.out_dir);
282+
283+
cmd.arg(path);
284+
285285
cmd.args(args);
286286
if cmd.spawn()?.wait()?.success() { Ok(()) } else { std::process::exit(1) }
287287
}

0 commit comments

Comments
 (0)