aboutsummaryrefslogtreecommitdiff
path: root/crates/tools/src/lib.rs
diff options
context:
space:
mode:
authorDJMcNab <[email protected]>2018-12-31 13:14:06 +0000
committerDJMcNab <[email protected]>2018-12-31 13:14:06 +0000
commitf61830d6768ecb0d2a9c5f4c80ed9c561c9daa6f (patch)
tree79c27f26e0c53e57bca3830aae0c2c6ff6107cfd /crates/tools/src/lib.rs
parent81acdafc518f858db38f1a3d78d9ff498c989176 (diff)
Add a fuzzing subcommand
Diffstat (limited to 'crates/tools/src/lib.rs')
-rw-r--r--crates/tools/src/lib.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index e5b32c25c..fa619af33 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -139,3 +139,20 @@ pub fn install_format_hook() -> Result<()> {
139 } 139 }
140 Ok(()) 140 Ok(())
141} 141}
142
143pub fn run_fuzzer() -> Result<()> {
144 match Command::new("cargo")
145 .args(&["fuzz", "--help"])
146 .stderr(Stdio::null())
147 .stdout(Stdio::null())
148 .status()
149 {
150 Ok(status) if status.success() => (),
151 _ => run("cargo install cargo-fuzz", ".")?,
152 };
153
154 run(
155 "rustup run nightly -- cargo fuzz run parser",
156 "./crates/ra_syntax",
157 )
158}