-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from dtolnay-contrib/check
Add `check` subcommand to perform a `cargo check`
- Loading branch information
Showing
5 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::{ | ||
options::{BuildMode, BuildOptions, FuzzDirWrapper}, | ||
project::FuzzProject, | ||
RunCommand, | ||
}; | ||
use anyhow::Result; | ||
use structopt::StructOpt; | ||
|
||
#[derive(Clone, Debug, StructOpt)] | ||
pub struct Check { | ||
#[structopt(flatten)] | ||
pub build: BuildOptions, | ||
|
||
#[structopt(flatten)] | ||
pub fuzz_dir_wrapper: FuzzDirWrapper, | ||
|
||
/// Name of the fuzz target to check, or check all targets if not supplied | ||
pub target: Option<String>, | ||
} | ||
|
||
impl RunCommand for Check { | ||
fn run_command(&mut self) -> Result<()> { | ||
let project = FuzzProject::new(self.fuzz_dir_wrapper.fuzz_dir.to_owned())?; | ||
project.exec_build( | ||
BuildMode::Check, | ||
&self.build, | ||
self.target.as_deref().map(|s| s), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters