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.
This commit is contained in:
commit
6cf851f6d4
@ -20,8 +20,8 @@ Usage:
|
||||
cargo miri [subcommand] [<cargo options>...] [--] [<program/test suite options>...]
|
||||
|
||||
Subcommands:
|
||||
run Run binaries
|
||||
test Run tests
|
||||
run, r Run binaries
|
||||
test, t Run tests
|
||||
setup Only perform automatic setup, but without asking questions (for getting a proper libstd)
|
||||
|
||||
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) {
|
||||
// We cannot know which of those flags take arguments and which do not,
|
||||
// so we cannot detect subcommands later.
|
||||
let subcommand = match args.next().as_deref() {
|
||||
Some("test") => MiriCommand::Test,
|
||||
Some("run") => MiriCommand::Run,
|
||||
Some("test" | "t") => MiriCommand::Test,
|
||||
Some("run" | "r") => MiriCommand::Run,
|
||||
Some("setup") => MiriCommand::Setup,
|
||||
// Invalid command.
|
||||
_ =>
|
||||
|
@ -97,8 +97,8 @@ def test_cargo_miri_run():
|
||||
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"'],
|
||||
"run.args.stdout.ref", "run.args.stderr.ref",
|
||||
)
|
||||
test("`cargo miri run` (subcrate, no ioslation)",
|
||||
cargo_miri("run") + ["-p", "subcrate"],
|
||||
test("`cargo miri r` (subcrate, no isolation)",
|
||||
cargo_miri("r") + ["-p", "subcrate"],
|
||||
"run.subcrate.stdout.ref", "run.subcrate.stderr.ref",
|
||||
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
|
||||
)
|
||||
@ -141,8 +141,8 @@ def test_cargo_miri_test():
|
||||
cargo_miri("test") + ["--bin", "cargo-miri-test", "--", "--format=pretty"],
|
||||
"test.bin-target.stdout.ref", "test.stderr-empty.ref",
|
||||
)
|
||||
test("`cargo miri test` (subcrate, no isolation)",
|
||||
cargo_miri("test") + ["-p", "subcrate"],
|
||||
test("`cargo miri t` (subcrate, no isolation)",
|
||||
cargo_miri("t") + ["-p", "subcrate"],
|
||||
"test.subcrate.stdout.ref", "test.stderr-proc-macro.ref",
|
||||
env={'MIRIFLAGS': "-Zmiri-disable-isolation"},
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user