Skip to content

Commit

Permalink
Showing 6 changed files with 416 additions and 302 deletions.
676 changes: 391 additions & 285 deletions fuzz/Cargo.lock

Large diffs are not rendered by default.

19 changes: 16 additions & 3 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "just-fuzz"
name = "just-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
@@ -8,8 +8,21 @@ edition = "2018"
[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"

[dependencies.just]
path = ".."

[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "compile"
path = "fuzz_targets/compile.rs"
test = false
doc = false

[profile.release]
debug = true
6 changes: 6 additions & 0 deletions fuzz/fuzz_targets/compile.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|src: &str| {
let _ = just::fuzzing::compile(src);
});
7 changes: 0 additions & 7 deletions fuzz/src/bin/fuzz-compiler.rs

This file was deleted.

8 changes: 2 additions & 6 deletions src/fuzzing.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use super::*;

pub(crate) fn compile(text: &str) {
if let Err(error) = Parser::parse(text) {
if let CompileErrorKind::Internal { .. } = error.kind {
panic!("{}", error)
}
}
pub fn compile(text: &str) {
let _ = compiler::Compiler::compile(text);
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ pub mod tree;
pub mod node;

#[cfg(fuzzing)]
pub(crate) mod fuzzing;
pub mod fuzzing;

// Used by Janus, https://github.com/casey/janus, a tool
// that analyses all public justfiles on GitHub to avoid

0 comments on commit eef0138

Please sign in to comment.