File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ required-features = ["native"]
6969bench = false
7070doc = false
7171name = " array_ops_unstable_encodings"
72- path = " fuzz_targets/array_ops .rs"
72+ path = " fuzz_targets/array_ops_unstable_encodings .rs"
7373test = false
7474required-features = [" native" ]
7575
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments