From a37cd5ad43f28e2eddab713266517cf06c256ba7 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 8 Sep 2018 16:55:53 +0200 Subject: Add trivial fuzzer for parser As described in #61, fuzz testing some parts of this would be ~~fun~~ helpful. So, I started with the most trivial fuzzer I could think of: Put random stuff into File::parse and see what happens. To speed things up, I also did cp src/**/*.rs fuzz/corpus/parser/ in the `crates/libsyntax2/` directory (running the fuzzer once will generate the necessary directories). --- crates/libsyntax2/fuzz/Cargo.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 crates/libsyntax2/fuzz/Cargo.toml (limited to 'crates/libsyntax2/fuzz/Cargo.toml') diff --git a/crates/libsyntax2/fuzz/Cargo.toml b/crates/libsyntax2/fuzz/Cargo.toml new file mode 100644 index 000000000..916cd5b6f --- /dev/null +++ b/crates/libsyntax2/fuzz/Cargo.toml @@ -0,0 +1,22 @@ + +[package] +name = "libsyntax2-fuzz" +version = "0.0.1" +authors = ["Automatically generated"] +publish = false + +[package.metadata] +cargo-fuzz = true + +[dependencies.libsyntax2] +path = ".." +[dependencies.libfuzzer-sys] +git = "https://github.com/rust-fuzz/libfuzzer-sys.git" + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[[bin]] +name = "parser" +path = "fuzz_targets/parser.rs" -- cgit v1.2.3