(
&self,
fuzzer_dir: &Path,
fuzzer_binary: &Path,
kind: Compile,
)
| 714 | } |
| 715 | |
| 716 | pub fn compile_lib_fuzzers( |
| 717 | &self, |
| 718 | fuzzer_dir: &Path, |
| 719 | fuzzer_binary: &Path, |
| 720 | kind: Compile, |
| 721 | ) -> Result<()> { |
| 722 | let mut drivers = Vec::new(); |
| 723 | for entry in std::fs::read_dir(fuzzer_dir)? { |
| 724 | let path = entry?.path(); |
| 725 | if path.is_file() |
| 726 | && path.extension().is_some() |
| 727 | && path.extension().unwrap().to_string_lossy() == "cc" |
| 728 | { |
| 729 | drivers.push(path); |
| 730 | } |
| 731 | } |
| 732 | // compile all the fuzzers into one binary. |
| 733 | let programs: Vec<&Path> = drivers.iter().map(|x| x.as_path()).collect(); |
| 734 | self.compile(programs, fuzzer_binary, kind) |
| 735 | } |
| 736 | |
| 737 | pub fn spawn_libfuzzer(&self, fuzzer_binary: &Path, corpus: &Path) -> Result<Child> { |
| 738 | let fuzzer_dir = crate::deopt::utils::get_file_dirname(fuzzer_binary); |
no test coverage detected