Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an overload of GenerateSeedCorpusFromConfig accepting the proto directly. #1245

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions centipede/seed_corpus_maker_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,15 @@ void GenerateSeedCorpusFromConfig( //
LOG(WARNING) << "Config is empty: skipping seed corpus generation";
return;
}
GenerateSeedCorpusFromConfig( //
config, coverage_binary_name, coverage_binary_hash, override_out_dir);
}

void GenerateSeedCorpusFromConfig( //
const SeedCorpusConfig& config, //
std::string_view coverage_binary_name, //
std::string_view coverage_binary_hash, //
std::string_view override_out_dir) {
// Pre-create the destination dir early to catch possible misspellings etc.
if (!RemotePathExists(config.destination().dir_path())) {
RemoteMkdir(config.destination().dir_path());
Expand Down
7 changes: 7 additions & 0 deletions centipede/seed_corpus_maker_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ void GenerateSeedCorpusFromConfig( //
std::string_view coverage_binary_hash, //
std::string_view override_out_dir = "");

// Same as above but accepts a `SeedCorpusConfig` directly.
void GenerateSeedCorpusFromConfig( //
const SeedCorpusConfig& config, //
std::string_view coverage_binary_name, //
std::string_view coverage_binary_hash, //
std::string_view override_out_dir = "");

} // namespace centipede

#endif // THIRD_PARTY_CENTIPEDE_SEED_CORPUS_MAKER_LIB_H_
Loading