Skip to content

Commit 6cf851f

Browse files
committed
Auto merge of #1890 - Smittyvb:cargo-miri-short-alias, r=RalfJung
One character aliases for cargo-miri run/test The main `cargo` command supports `cargo r` as an alias for `cargo run`, and `cargo t` as an alias for `cargo test`. This adds support to them in `cargo-miri` for consistency.
2 parents 82901dc + 4df9314 commit 6cf851f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cargo-miri/bin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Usage:
2020
cargo miri [subcommand] [<cargo options>...] [--] [<program/test suite options>...]
2121
2222
Subcommands:
23-
run Run binaries
24-
test Run tests
23+
run, r Run binaries
24+
test, t Run tests
2525
setup Only perform automatic setup, but without asking questions (for getting a proper libstd)
2626
2727
The cargo options are exactly the same as for `cargo run` and `cargo test`, respectively.
@@ -524,8 +524,8 @@ fn phase_cargo_miri(mut args: env::Args) {
524524
// We cannot know which of those flags take arguments and which do not,
525525
// so we cannot detect subcommands later.
526526
let subcommand = match args.next().as_deref() {
527-
Some("test") => MiriCommand::Test,
528-
Some("run") => MiriCommand::Run,
527+
Some("test" | "t") => MiriCommand::Test,
528+
Some("run" | "r") => MiriCommand::Run,
529529
Some("setup") => MiriCommand::Setup,
530530
// Invalid command.
531531
_ =>

test-cargo-miri/run-test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def test_cargo_miri_run():
9797
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"'],
9898
"run.args.stdout.ref", "run.args.stderr.ref",
9999
)
100-
test("`cargo miri run` (subcrate, no ioslation)",
101-
cargo_miri("run") + ["-p", "subcrate"],
100+
test("`cargo miri r` (subcrate, no isolation)",
101+
cargo_miri("r") + ["-p", "subcrate"],
102102
"run.subcrate.stdout.ref", "run.subcrate.stderr.ref",
103103
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
104104
)
@@ -141,8 +141,8 @@ def test_cargo_miri_test():
141141
cargo_miri("test") + ["--bin", "cargo-miri-test", "--", "--format=pretty"],
142142
"test.bin-target.stdout.ref", "test.stderr-empty.ref",
143143
)
144-
test("`cargo miri test` (subcrate, no isolation)",
145-
cargo_miri("test") + ["-p", "subcrate"],
144+
test("`cargo miri t` (subcrate, no isolation)",
145+
cargo_miri("t") + ["-p", "subcrate"],
146146
"test.subcrate.stdout.ref", "test.stderr-proc-macro.ref",
147147
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
148148
)

0 commit comments

Comments
 (0)