mirror of
https://github.com/fanzeyi/cargo-play
synced 2025-02-18 01:38:24 +00:00
merge #22
This commit is contained in:
commit
040a52ae4f
2 changed files with 7 additions and 1 deletions
|
@ -55,6 +55,10 @@ pub struct Opt {
|
||||||
/// Rebuild the cargo project without the cache from previous run
|
/// Rebuild the cargo project without the cache from previous run
|
||||||
pub clean: bool,
|
pub clean: bool,
|
||||||
|
|
||||||
|
#[structopt(long = "test")]
|
||||||
|
/// Build and run only tests in module
|
||||||
|
pub test: bool,
|
||||||
|
|
||||||
#[structopt(short = "t", long = "toolchain", hidden = true)]
|
#[structopt(short = "t", long = "toolchain", hidden = true)]
|
||||||
pub toolchain: Option<String>,
|
pub toolchain: Option<String>,
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,10 @@ pub fn run_cargo_build(options: &Opt, project: &PathBuf) -> Result<ExitStatus, C
|
||||||
cargo.arg(format!("+{}", toolchain));
|
cargo.arg(format!("+{}", toolchain));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let subcommand = if options.test { "test" } else { "run" };
|
||||||
|
|
||||||
cargo
|
cargo
|
||||||
.arg("run")
|
.arg(subcommand)
|
||||||
.arg("--manifest-path")
|
.arg("--manifest-path")
|
||||||
.arg(project.join("Cargo.toml"));
|
.arg(project.join("Cargo.toml"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue