Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
3ab9f4ad7fa44cb20c0a13ae69f76ee13e4f53d2
rust/crates/libsyntax2/fuzz/fuzz_targets/parser.rs

10 lines
223 B
Rust
Raw Normal View History

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).
2018-09-08 16:55:53 +02:00
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate libsyntax2;
fuzz_target!(|data: &[u8]| {
if let Ok(text) = std::str::from_utf8(data) {
move fuzz-invariants to the library
2018-09-08 18:34:41 +03:00
libsyntax2::utils::check_fuzz_invariants(text)
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).
2018-09-08 16:55:53 +02:00
}
});
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 97ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API