diff options
| author | DJMcNab <36049421+DJMcNab@users.noreply.github.com> | 2018-12-31 13:14:06 +0000 |
|---|---|---|
| committer | DJMcNab <36049421+DJMcNab@users.noreply.github.com> | 2018-12-31 13:14:06 +0000 |
| commit | f61830d6768ecb0d2a9c5f4c80ed9c561c9daa6f (patch) | |
| tree | 79c27f26e0c53e57bca3830aae0c2c6ff6107cfd /crates/tools/src/lib.rs | |
| parent | 81acdafc518f858db38f1a3d78d9ff498c989176 (diff) | |
| download | rust-f61830d6768ecb0d2a9c5f4c80ed9c561c9daa6f.tar.gz rust-f61830d6768ecb0d2a9c5f4c80ed9c561c9daa6f.zip | |
Add a fuzzing subcommand
Diffstat (limited to 'crates/tools/src/lib.rs')
| -rw-r--r-- | crates/tools/src/lib.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index e5b32c25ce4..fa619af333b 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -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", + ) +} |
