Add a fuzzing subcommand

This commit is contained in:
DJMcNab
2018-12-31 13:14:06 +00:00
parent 81acdafc51
commit f61830d676
3 changed files with 35 additions and 7 deletions

View File

@@ -139,3 +139,20 @@ pub fn install_format_hook() -> Result<()> {
}
Ok(())
}
pub fn run_fuzzer() -> Result<()> {
match Command::new("cargo")
.args(&["fuzz", "--help"])
.stderr(Stdio::null())
.stdout(Stdio::null())
.status()
{
Ok(status) if status.success() => (),
_ => run("cargo install cargo-fuzz", ".")?,
};
run(
"rustup run nightly -- cargo fuzz run parser",
"./crates/ra_syntax",
)
}