(project: String, kind: Compile, exploit: bool)
| 205 | } |
| 206 | |
| 207 | fn compile_fuzzer(project: String, kind: Compile, exploit: bool) -> Result<()> { |
| 208 | let deopt = Deopt::new(project)?; |
| 209 | let executor = Executor::new(&deopt)?; |
| 210 | for dir in std::fs::read_dir(deopt.get_library_fuzzer_dir(exploit)?)? { |
| 211 | let fuzzer_dir = dir?.path(); |
| 212 | if fuzzer_dir.is_dir() { |
| 213 | log::info!("Compile to Fuzzer: {fuzzer_dir:?}"); |
| 214 | let fuzzer_name = match kind { |
| 215 | Compile::SANITIZE => "fuzzer_san", |
| 216 | Compile::FUZZER => "fuzzer", |
| 217 | Compile::COVERAGE => "fuzzer_cov", |
| 218 | Compile::Minimize => "fuzzer_evo", |
| 219 | }; |
| 220 | let fuzzer_binary: PathBuf = [fuzzer_dir.clone(), fuzzer_name.into()].iter().collect(); |
| 221 | executor.compile_lib_fuzzers(&fuzzer_dir, &fuzzer_binary, kind.clone())?; |
| 222 | deopt.copy_library_init_file(&fuzzer_dir)?; |
| 223 | } |
| 224 | } |
| 225 | Ok(()) |
| 226 | } |
| 227 | |
| 228 | fn archive(project: String, suffix: &Option<String>) -> Result<()> { |
| 229 | let current_date = Local::now().format("%Y-%m-%d").to_string(); |
no test coverage detected