mirror of
https://github.com/oxalica/nil.git
synced 2024-10-27 12:30:52 +03:00
Setup fuzzer for parser
This commit is contained in:
parent
f2006b83d1
commit
9f9dc6a9ae
@ -44,5 +44,13 @@
|
|||||||
export NIL_PATH="$(cargo metadata --format-version=1 | jq -r .target_directory)/release/nil"
|
export NIL_PATH="$(cargo metadata --format-version=1 | jq -r .target_directory)/release/nil"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
devShells.fuzz = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
rustPkgs.rust-nightly_2022-08-01
|
||||||
|
pkgs.cargo-fuzz
|
||||||
|
];
|
||||||
|
RUST_BACKTRACE = 1;
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
4
syntax/fuzz/.gitignore
vendored
Normal file
4
syntax/fuzz/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
target
|
||||||
|
corpus
|
||||||
|
artifacts
|
||||||
|
Cargo.lock
|
25
syntax/fuzz/Cargo.toml
Normal file
25
syntax/fuzz/Cargo.toml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[package]
|
||||||
|
name = "syntax-fuzz"
|
||||||
|
version = "0.0.0"
|
||||||
|
authors = ["Automatically generated"]
|
||||||
|
publish = false
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
cargo-fuzz = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
libfuzzer-sys = "0.4"
|
||||||
|
|
||||||
|
[dependencies.syntax]
|
||||||
|
path = ".."
|
||||||
|
|
||||||
|
# Prevent this from interfering with workspaces
|
||||||
|
[workspace]
|
||||||
|
members = ["."]
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "parser"
|
||||||
|
path = "fuzz_targets/parser.rs"
|
||||||
|
test = false
|
||||||
|
doc = false
|
6
syntax/fuzz/fuzz_targets/parser.rs
Normal file
6
syntax/fuzz/fuzz_targets/parser.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#![no_main]
|
||||||
|
use libfuzzer_sys::fuzz_target;
|
||||||
|
|
||||||
|
fuzz_target!(|text: &str| {
|
||||||
|
syntax::parse_file(text);
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user