mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 05:44:26 +00:00
Allow running a test as a binary
This commit is contained in:
parent
84acd56e97
commit
964219f0be
@ -72,7 +72,11 @@ impl CargoTargetSpec {
|
||||
extra_args.push("--nocapture".to_string());
|
||||
}
|
||||
RunnableKind::Bin => {
|
||||
args.push("run".to_string());
|
||||
let subcommand = match spec {
|
||||
Some(CargoTargetSpec { target_kind: TargetKind::Test, .. }) => "test",
|
||||
_ => "run",
|
||||
};
|
||||
args.push(subcommand.to_string());
|
||||
if let Some(spec) = spec {
|
||||
spec.push_to(&mut args, kind);
|
||||
}
|
||||
|
@ -1399,7 +1399,10 @@ fn should_skip_target(runnable: &Runnable, cargo_spec: Option<&CargoTargetSpec>)
|
||||
RunnableKind::Bin => {
|
||||
// Do not suggest binary run on other target than binary
|
||||
match &cargo_spec {
|
||||
Some(spec) => !matches!(spec.target_kind, TargetKind::Bin | TargetKind::Example),
|
||||
Some(spec) => !matches!(
|
||||
spec.target_kind,
|
||||
TargetKind::Bin | TargetKind::Example | TargetKind::Test
|
||||
),
|
||||
None => true,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user