()
| 330 | } |
| 331 | |
| 332 | fn main() -> ExitCode { |
| 333 | let config = Config::parse(); |
| 334 | prompt_fuzz::config::Config::init_test(&config.project); |
| 335 | let project = config.project.clone(); |
| 336 | match &config.command { |
| 337 | Commands::Check { program } => { |
| 338 | let res: Option<ProgramError> = check(project, program).unwrap(); |
| 339 | if let Some(err) = res { |
| 340 | let dump_err = serde_json::to_string(&err).unwrap(); |
| 341 | eprintln!("{dump_err}"); |
| 342 | return ExitCode::from(41); |
| 343 | } |
| 344 | return ExitCode::SUCCESS; |
| 345 | } |
| 346 | Commands::ReCheck => { |
| 347 | recheck(project).unwrap(); |
| 348 | return ExitCode::SUCCESS; |
| 349 | } |
| 350 | Commands::Transform { |
| 351 | program, |
| 352 | use_cons, |
| 353 | corpora, |
| 354 | } => { |
| 355 | let res = transform(project, program, *use_cons, corpora.clone()); |
| 356 | if let Err(err) = res { |
| 357 | eprintln!("{}", err); |
| 358 | return ExitCode::from(42); |
| 359 | } |
| 360 | return ExitCode::SUCCESS; |
| 361 | } |
| 362 | Commands::FuzzerRun { |
| 363 | use_cons, |
| 364 | time_limit, |
| 365 | minimize, |
| 366 | } => { |
| 367 | let res = fuzzer_run(project, *use_cons, *time_limit, *minimize); |
| 368 | if let Err(err) = res { |
| 369 | eprintln!("{}", err); |
| 370 | return ExitCode::from(43); |
| 371 | } |
| 372 | return ExitCode::SUCCESS; |
| 373 | } |
| 374 | Commands::Coverage { kind, exploit } => { |
| 375 | return collect_cov(project, kind, *exploit); |
| 376 | } |
| 377 | Commands::Archive { suffix } => { |
| 378 | archive(project, suffix).unwrap(); |
| 379 | } |
| 380 | Commands::Adg { kind, target } => { |
| 381 | build_adg(project, kind, target).unwrap(); |
| 382 | } |
| 383 | Commands::FuseFuzzer { |
| 384 | use_cons, |
| 385 | n_fuzzer, |
| 386 | seed_dir, |
| 387 | } => { |
| 388 | fuse_fuzzer(project, seed_dir, *n_fuzzer, *use_cons).unwrap(); |
| 389 | } |
nothing calls this directly
no test coverage detected