Skip to content

Commit 26c9617

Browse files
Factor out output_coverage_report into bmc_util
1 parent d2e3959 commit 26c9617

5 files changed

+34
-15
lines changed

src/goto-checker/bmc_util.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,19 @@ void update_properties_status_not_checked(
276276
}
277277
}
278278
}
279+
280+
void output_coverage_report(
281+
const std::string &cov_out,
282+
const abstract_goto_modelt &goto_model,
283+
const symex_bmct &symex,
284+
ui_message_handlert &ui_message_handler)
285+
{
286+
if(
287+
!cov_out.empty() &&
288+
symex.output_coverage_report(goto_model.get_goto_functions(), cov_out))
289+
{
290+
messaget log(ui_message_handler);
291+
log.error() << "Failed to write symex coverage report to '" << cov_out
292+
<< "'" << messaget::eom;
293+
}
294+
}

src/goto-checker/bmc_util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ void slice(
6969
const optionst &,
7070
ui_message_handlert &);
7171

72+
void output_coverage_report(
73+
const std::string &cov_out,
74+
const abstract_goto_modelt &goto_model,
75+
const symex_bmct &symex,
76+
ui_message_handlert &ui_message_handler);
77+
7278
/// Sets property status to PASS for properties whose
7379
/// conditions are constant true in the \p equation.
7480
/// \param [inout] properties: The status is updated in this data structure

src/goto-checker/multi_path_symex_checker.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ operator()(propertiest &properties)
4040
if(!symex_has_run)
4141
{
4242
perform_symex();
43-
output_coverage_report();
43+
44+
output_coverage_report(
45+
options.get_option("symex-coverage-report"),
46+
goto_model,
47+
symex,
48+
ui_message_handler);
49+
4450
update_properties_status_from_symex_target_equation(
4551
properties, result.updated_properties, equation);
4652
// Since we will not symex any further we can decide the status

src/goto-checker/multi_path_symex_only_checker.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ operator()(propertiest &properties)
4141
{
4242
perform_symex();
4343

44-
output_coverage_report();
44+
output_coverage_report(
45+
options.get_option("symex-coverage-report"),
46+
goto_model,
47+
symex,
48+
ui_message_handler);
4549

4650
if(options.get_bool_option("show-vcc"))
4751
{
@@ -95,15 +99,3 @@ void multi_path_symex_only_checkert::perform_symex()
9599
symex.validate(validation_modet::INVARIANT);
96100
}
97101
}
98-
99-
void multi_path_symex_only_checkert::output_coverage_report()
100-
{
101-
std::string cov_out = options.get_option("symex-coverage-report");
102-
if(
103-
!cov_out.empty() &&
104-
symex.output_coverage_report(goto_model.get_goto_functions(), cov_out))
105-
{
106-
log.error() << "Failed to write symex coverage report to '" << cov_out
107-
<< "'" << messaget::eom;
108-
}
109-
}

src/goto-checker/multi_path_symex_only_checker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class multi_path_symex_only_checkert : public incremental_goto_checkert
3535
symex_bmct symex;
3636

3737
void perform_symex();
38-
void output_coverage_report();
3938
};
4039

4140
#endif // CPROVER_GOTO_CHECKER_MULTI_PATH_SYMEX_ONLY_CHECKER_H

0 commit comments

Comments
 (0)