adjust the fuzzers to use the new structure

This commit is contained in:
Sylvestre Ledru
2024-01-22 22:32:11 +01:00
parent 0b2505d249
commit f42fc82f18
9 changed files with 35 additions and 19 deletions
+4
View File
@@ -6,6 +6,10 @@ description = "A CLI app for generating diff files"
license = "MIT OR Apache-2.0"
repository = "https://github.com/notriddle/diffutils"
[lib]
name = "diffutils"
path = "src/lib.rs"
[[bin]]
name = "diffutils"
path = "src/main.rs"
@@ -10,9 +10,7 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.3"
[dependencies.unified-diff]
path = ".."
diffutils = { path = "../" }
# Prevent this from interfering with workspaces
[workspace]
@@ -24,3 +22,17 @@ path = "fuzz_targets/fuzz_patch.rs"
test = false
doc = false
[[bin]]
name = "fuzz_normal"
path = "fuzz_targets/fuzz_normal.rs"
test = false
doc = false
[[bin]]
name = "fuzz_ed"
path = "fuzz_targets/fuzz_ed.rs"
test = false
doc = false
@@ -1,8 +1,7 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate ed_diff;
use diffutils::{unified_diff, ed_diff, normal_diff};
use std::fs::{self, File};
use std::io::Write;
use std::process::Command;
@@ -1,7 +1,7 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate normal_diff;
use diffutils::{unified_diff, normal_diff};
use std::fs::{self, File};
use std::io::Write;
@@ -1,8 +1,7 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate unified_diff;
use diffutils::{unified_diff, normal_diff};
use std::fs::{self, File};
use std::io::Write;
use std::process::Command;
+1 -11
View File
@@ -3,7 +3,7 @@
name = "normal-diff-fuzz"
version = "0.0.0"
publish = false
edition = "2018"
edition = "2021"
[package.metadata]
cargo-fuzz = true
@@ -11,16 +11,6 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.3"
[dependencies.normal-diff]
path = ".."
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "fuzz_patch"
path = "fuzz_targets/fuzz_patch.rs"
test = false
doc = false
+11
View File
@@ -0,0 +1,11 @@
pub mod unified_diff;
pub mod normal_diff;
pub mod ed_diff;
pub mod context_diff;
// Re-export the public functions/types you need
pub use unified_diff::diff as unified_diff;
pub use normal_diff::diff as normal_diff;
pub use ed_diff::diff as ed_diff;
pub use context_diff::diff as context_diff;
+1
View File
@@ -9,6 +9,7 @@ use std::env;
use std::fs;
use std::io::{self, Write};
mod params;
mod normal_diff;
mod unified_diff;