@@ -71,7 +71,37 @@ fn integration_maze() {
71
71
return ;
72
72
}
73
73
74
- fuzz_example ( "maze" , true ) ;
74
+ let mut fail = 0 ;
75
+ let temp_dir = tempfile:: TempDir :: new ( ) . expect ( "Could not create temporary directory" ) ;
76
+ let temp_dir_path = temp_dir. path ( ) ;
77
+
78
+ for i in 0 ..3 {
79
+ let _: ExitStatus = process:: Command :: new ( cargo_afl_path ( ) )
80
+ . arg ( "afl" )
81
+ . arg ( "fuzz" )
82
+ . arg ( "-i" )
83
+ . arg ( input_path ( ) )
84
+ . arg ( "-o" )
85
+ . arg ( temp_dir_path)
86
+ . args ( [ "-V" , "15" ] ) // 15 seconds
87
+ . arg ( examples_path ( "maze" ) )
88
+ . env ( "AFL_BENCH_UNTIL_CRASH" , "1" )
89
+ . env ( "AFL_NO_CRASH_README" , "1" )
90
+ . env ( "AFL_NO_UI" , "1" )
91
+ . stdout ( process:: Stdio :: inherit ( ) )
92
+ . stderr ( process:: Stdio :: inherit ( ) )
93
+ . status ( )
94
+ . expect ( "Could not run cargo afl fuzz" ) ;
95
+ assert ! ( temp_dir_path. join( "default" ) . join( "fuzzer_stats" ) . is_file( ) ) ;
96
+ let crashes = std:: fs:: read_dir ( temp_dir_path. join ( "default" ) . join ( "crashes" ) )
97
+ . unwrap ( )
98
+ . count ( ) ;
99
+ if ( crashes >= 1 ) {
100
+ return ;
101
+ }
102
+ }
103
+
104
+ assert ! ( false ) ;
75
105
}
76
106
77
107
fn fuzz_example ( name : & str , should_crash : bool ) {
@@ -84,7 +114,7 @@ fn fuzz_example(name: &str, should_crash: bool) {
84
114
. arg ( input_path ( ) )
85
115
. arg ( "-o" )
86
116
. arg ( temp_dir_path)
87
- . args ( [ "-V" , "10 " ] ) // 5 seconds
117
+ . args ( [ "-V" , "5 " ] ) // 5 seconds
88
118
. arg ( examples_path ( name) )
89
119
. env ( "AFL_BENCH_UNTIL_CRASH" , "1" )
90
120
. env ( "AFL_NO_CRASH_README" , "1" )
0 commit comments