From 0cd16d6e4b6672c928f41d36fa0b4d13c112652a Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Sat, 22 Oct 2022 23:33:25 +0800 Subject: [PATCH] test: add 8 client fuzz text test --- crates/loro-core/fuzz/Cargo.toml | 6 ++++++ crates/loro-core/fuzz/fuzz_targets/text.rs | 5 +++++ crates/loro-core/justfile | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 crates/loro-core/fuzz/fuzz_targets/text.rs diff --git a/crates/loro-core/fuzz/Cargo.toml b/crates/loro-core/fuzz/Cargo.toml index 64e2eb52..083ab152 100644 --- a/crates/loro-core/fuzz/Cargo.toml +++ b/crates/loro-core/fuzz/Cargo.toml @@ -41,3 +41,9 @@ name = "two_client_text" path = "fuzz_targets/two_client_text.rs" test = false doc = false + +[[bin]] +name = "text" +path = "fuzz_targets/text.rs" +test = false +doc = false diff --git a/crates/loro-core/fuzz/fuzz_targets/text.rs b/crates/loro-core/fuzz/fuzz_targets/text.rs new file mode 100644 index 00000000..5e3bbc9c --- /dev/null +++ b/crates/loro-core/fuzz/fuzz_targets/text.rs @@ -0,0 +1,5 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; +use loro_core::fuzz::{test_multi_sites, Action}; + +fuzz_target!(|actions: Vec| { test_multi_sites(8, actions) }); diff --git a/crates/loro-core/justfile b/crates/loro-core/justfile index 2ff73a0e..ca88379d 100644 --- a/crates/loro-core/justfile +++ b/crates/loro-core/justfile @@ -21,7 +21,9 @@ fuzz-yata-long: cargo fuzz run yata -- -max_total_time=300 -max_len=4000 -jobs=2 quick-fuzz: - cargo fuzz run single_client_text -- -max_total_time=10 -max_len=1000 & cargo fuzz run yata -- -max_total_time=10 -max_len=1000 + cargo fuzz run single_client_text -- -max_total_time=10 -max_len=1000 & + cargo fuzz run yata -- -max_total_time=10 -max_len=1000 & + cargo fuzz run two_client_text -- -max_total_time=10 -max_len=1000 flame: cargo flamegraph --example test --features=fuzzing --root