Skip to content

Commit 27fcd28

Browse files
committed
fix: disambiguate array ops files
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
1 parent f03a0c7 commit 27fcd28

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ required-features = ["native"]
6969
bench = false
7070
doc = false
7171
name = "array_ops_unstable_encodings"
72-
path = "fuzz_targets/array_ops.rs"
72+
path = "fuzz_targets/array_ops_unstable_encodings.rs"
7373
test = false
7474
required-features = ["native"]
7575

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
#![no_main]
5+
#![allow(clippy::unwrap_used, clippy::result_large_err)]
6+
7+
use std::str::FromStr;
8+
9+
use libfuzzer_sys::Corpus;
10+
use libfuzzer_sys::fuzz_target;
11+
use tracing::level_filters::LevelFilter;
12+
use vortex_error::vortex_panic;
13+
use vortex_fuzz::FuzzArrayAction;
14+
use vortex_fuzz::run_fuzz_action;
15+
16+
fuzz_target!(
17+
init: {
18+
let fmt = tracing_subscriber::fmt::format()
19+
.with_ansi(false) // Colour output is messed up in raw logs
20+
.without_time() // We run fuzzer in CI which prepends timestamps
21+
.compact();
22+
let level = std::env::var("RUST_LOG").map(
23+
|v| LevelFilter::from_str(v.as_str()).unwrap()).unwrap_or(LevelFilter::INFO);
24+
tracing_subscriber::fmt()
25+
.event_format(fmt)
26+
.with_max_level(level)
27+
.init();
28+
},
29+
|fuzz_action: FuzzArrayAction| -> Corpus {
30+
match run_fuzz_action(fuzz_action) {
31+
Ok(true) => Corpus::Keep,
32+
Ok(false) => Corpus::Reject,
33+
Err(e) => vortex_panic!("{e}"),
34+
}
35+
});

0 commit comments

Comments
 (0)