| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
use std::fs; |
| 14 |
use std::path::Path; |
| 15 |
|
| 16 |
#[test] |
| 17 |
fn every_fuzz_regression_still_passes() { |
| 18 |
let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("fuzz/regressions"); |
| 19 |
let Ok(entries) = fs::read_dir(&dir) else { |
| 20 |
|
| 21 |
|
| 22 |
println!("no regressions directory at {}", dir.display()); |
| 23 |
return; |
| 24 |
}; |
| 25 |
|
| 26 |
let mut checked = 0usize; |
| 27 |
for entry in entries { |
| 28 |
let path = entry.expect("reading a regression entry").path(); |
| 29 |
if !path.is_file() { |
| 30 |
continue; |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
let input = |
| 36 |
String::from_utf8_lossy(&fs::read(&path).expect("reading a regression")).into_owned(); |
| 37 |
docengine::oracle::check(&input); |
| 38 |
checked += 1; |
| 39 |
} |
| 40 |
println!( |
| 41 |
"replayed {checked} fuzz regression(s) from {}", |
| 42 |
dir.display() |
| 43 |
); |
| 44 |
} |
| 45 |
|