Skip to content

Commit 3878d1b

Browse files
Use goto verifier for --cover in CBMC
instead of bmc_covert Fixes --cover tests without property descriptions. The unified property handling introduced in a1100e1 used by goto verifier does not allow properties without description.
1 parent 894f8ec commit 3878d1b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

regression/cbmc-cover/assertion1/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ main.c
33
--cover assertion
44
^EXIT=0$
55
^SIGNAL=0$
6-
^\[main.coverage.1\] file main.c line 9 function main: SATISFIED$
7-
^\[main.coverage.2\] file main.c line 13 function main: SATISFIED$
6+
^\[main.coverage.1\] file main.c line 9 function main assertion: SATISFIED$
7+
^\[main.coverage.2\] file main.c line 13 function main assertion: SATISFIED$
88
--
99
^warning: ignoring

src/cbmc/cbmc_parse_options.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Author: Daniel Kroening, [email protected]
3636
#include <goto-checker/all_properties_verifier.h>
3737
#include <goto-checker/all_properties_verifier_with_trace_storage.h>
3838
#include <goto-checker/bmc_util.h>
39+
#include <goto-checker/cover_goals_verifier_with_trace_storage.h>
3940
#include <goto-checker/multi_path_symex_checker.h>
4041
#include <goto-checker/multi_path_symex_only_checker.h>
4142
#include <goto-checker/properties.h>
@@ -73,6 +74,7 @@ Author: Daniel Kroening, [email protected]
7374

7475
#include <langapi/mode.h>
7576

77+
#include "c_test_input_generator.h"
7678
#include "xml_interface.h"
7779

7880
cbmc_parse_optionst::cbmc_parse_optionst(int argc, const char **argv)
@@ -578,6 +580,19 @@ int cbmc_parse_optionst::doit()
578580
}
579581
}
580582

583+
if(options.is_set("cover"))
584+
{
585+
cover_goals_verifier_with_trace_storaget<multi_path_symex_checkert>
586+
verifier(options, ui_message_handler, goto_model);
587+
(void)verifier();
588+
verifier.report();
589+
590+
c_test_input_generatort test_generator(ui_message_handler, options);
591+
test_generator(verifier.get_traces());
592+
593+
return CPROVER_EXIT_SUCCESS;
594+
}
595+
581596
std::unique_ptr<goto_verifiert> verifier = nullptr;
582597

583598
if(
@@ -607,6 +622,7 @@ int cbmc_parse_optionst::doit()
607622

608623
resultt result = (*verifier)();
609624
verifier->report();
625+
610626
return result_to_exit_code(result);
611627
}
612628

0 commit comments

Comments
 (0)