mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 09:25:02 +01:00
move fuzzing code to lib
This commit is contained in:
parent
f222e0cb10
commit
6215924049
8 changed files with 102 additions and 23 deletions
|
|
@ -19,13 +19,19 @@ path = ".."
|
|||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "lex"
|
||||
path = "fuzz_targets/lex.rs"
|
||||
name = "lexer"
|
||||
path = "fuzz_targets/lexer.rs"
|
||||
test = false
|
||||
doc = false
|
||||
|
||||
[[bin]]
|
||||
name = "lex_parse"
|
||||
path = "fuzz_targets/lex_parse.rs"
|
||||
name = "parser"
|
||||
path = "fuzz_targets/parser.rs"
|
||||
test = false
|
||||
doc = false
|
||||
|
||||
[[bin]]
|
||||
name = "compiler"
|
||||
path = "fuzz_targets/compiler.rs"
|
||||
test = false
|
||||
doc = false
|
||||
|
|
|
|||
|
|
@ -2,6 +2,5 @@
|
|||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: String| {
|
||||
let lexer = dilaria::Lexer::new(&data);
|
||||
for _ in lexer {}
|
||||
dilaria::_fuzz_compile(&data);
|
||||
});
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: String| {
|
||||
let ast_alloc = dilaria::Bump::new();
|
||||
|
||||
let lexer = dilaria::Lexer::new(&data);
|
||||
|
||||
let _ast = dilaria::parse(lexer, &ast_alloc);
|
||||
});
|
||||
6
fuzz/fuzz_targets/lexer.rs
Normal file
6
fuzz/fuzz_targets/lexer.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: String| {
|
||||
dilaria::_fuzz_lex(&data);
|
||||
});
|
||||
6
fuzz/fuzz_targets/parser.rs
Normal file
6
fuzz/fuzz_targets/parser.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
fuzz_target!(|data: String| {
|
||||
dilaria::_fuzz_parse(&data);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue