Skip to content

Move coverage arg-parsing into cover.cpp #857

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

Merged
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
25 changes: 24 additions & 1 deletion src/goto-instrument/cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1769,10 +1769,33 @@ bool instrument_cover_goals(
}
}

// check existing test goals
coverage_goalst existing_goals;
if(cmdline.isset("existing-coverage"))
{
msg.status() << "Check existing coverage goals" << messaget::eom;
// get file with covered test goals
const std::string coverage=cmdline.get_value("existing-coverage");
// get a coverage_goalst object
if(coverage_goalst::get_coverage_goals(coverage, msgh, existing_goals))
{
msg.error() << "get_coverage_goals failed" << messaget::eom;
return true;
}
}

msg.status() << "Instrumenting coverage goals" << messaget::eom;

for(const auto &criterion : criteria)
instrument_cover_goals(symbol_table, goto_functions, criterion);
{
instrument_cover_goals(
symbol_table,
goto_functions,
criterion,
existing_goals,
cmdline.isset("cover-function-only"),
cmdline.isset("no-trivial-tests"));
}

goto_functions.update();
return false;
Expand Down