diff options
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 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 | |||
143 | pub 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 | } | ||