cprover
cover.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Coverage Instrumentation
4 
5 Author: Daniel Kroening
6 
7 Date: May 2016
8 
9 \*******************************************************************/
10 
13 
14 #ifndef CPROVER_GOTO_INSTRUMENT_COVER_H
15 #define CPROVER_GOTO_INSTRUMENT_COVER_H
16 
17 #include "cover_filter.h"
18 #include "cover_instrument.h"
19 #include "util/make_unique.h"
20 
21 class message_handlert;
22 class cmdlinet;
23 class optionst;
24 
25 #define OPT_COVER \
26  "(cover):" \
27  "(cover-failed-assertions)" \
28  "(show-test-suite)"
29 
30 #define HELP_COVER \
31  " --cover CC create test-suite with coverage criterion " \
32  "CC\n" \
33  " --cover-failed-assertions do not stop coverage checking at failed " \
34  "assertions\n" \
35  " (this is the default for --cover " \
36  "assertions)\n" \
37  " --show-test-suite print test suite for coverage criterion " \
38  "(requires --cover)\n"
39 
41 {
42  LOCATION,
43  BRANCH,
44  DECISION,
45  CONDITION,
46  PATH,
47  MCDC,
48  ASSERTION,
49  COVER // __CPROVER_cover(x) annotations
50 };
51 
53 {
59  // cover instruments point to goal_filters, so they must be stored on the heap
60  std::unique_ptr<goal_filterst> goal_filters =
61  util_make_unique<goal_filterst>();
65 };
66 
68  const symbol_tablet &,
69  const cover_configt &,
72  message_handlert &message_handler);
73 
75  const symbol_tablet &,
76  const cover_configt &,
77  goto_programt &,
79  message_handlert &message_handler);
80 
83 
85  const optionst &,
86  const irep_idt &main_function_id,
87  const symbol_tablet &,
89 
91  const cover_configt &,
94 
95 void parse_cover_options(const cmdlinet &, optionst &);
96 
98  const cover_configt &,
99  const symbol_tablet &,
100  goto_functionst &,
101  message_handlert &);
102 
104  const cover_configt &,
105  goto_modelt &,
106  message_handlert &);
107 
108 #endif // CPROVER_GOTO_INSTRUMENT_COVER_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:37
get_cover_config
cover_configt get_cover_config(const optionst &, const symbol_tablet &, message_handlert &)
Build data structures controlling coverage from command-line options.
Definition: cover.cpp:179
symbol_tablet
The symbol table.
Definition: symbol_table.h:20
complexity_violationt::NONE
@ NONE
cover_configt::goal_filters
std::unique_ptr< goal_filterst > goal_filters
Definition: cover.h:60
optionst
Definition: options.h:23
parse_cover_options
void parse_cover_options(const cmdlinet &, optionst &)
Parses coverage-related command line options.
Definition: cover.cpp:141
cover_configt::cover_failed_assertions
bool cover_failed_assertions
Definition: cover.h:55
goto_modelt
Definition: goto_model.h:26
coverage_criteriont
coverage_criteriont
Definition: cover.h:41
cover_configt::mode
irep_idt mode
Definition: cover.h:57
coverage_criteriont::LOCATION
@ LOCATION
cover_configt::cover_instrumenters
cover_instrumenterst cover_instrumenters
Definition: cover.h:62
cmdlinet
Definition: cmdline.h:21
goto_programt::make_assertion
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
Definition: goto_program.h:877
instrument_cover_goals
void instrument_cover_goals(const symbol_tablet &, const cover_configt &, goto_functionst &, coverage_criteriont, message_handlert &message_handler)
make_unique.h
cover_configt::traces_must_terminate
bool traces_must_terminate
Definition: cover.h:56
cover_configt::make_assertion
cover_instrumenter_baset::assertion_factoryt make_assertion
Definition: cover.h:63
cover_instrument.h
Coverage Instrumentation.
message_handlert
Definition: message.h:28
cover_instrumenter_baset::assertion_factoryt
std::function< goto_programt::instructiont(const exprt &, const source_locationt &)> assertion_factoryt
The type of function used to make goto_program assertions.
Definition: cover_instrument.h:41
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:23
cover_configt::function_filters
function_filterst function_filters
Definition: cover.h:58
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:74
cover_configt
Definition: cover.h:53
function_filterst
A collection of function filters to be applied in conjunction.
Definition: cover_filter.h:65
goto_model_functiont
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
Definition: goto_model.h:183
cover_filter.h
Filters for the Coverage Instrumentation.
cover_configt::keep_assertions
bool keep_assertions
Definition: cover.h:54
cover_instrumenterst
A collection of instrumenters to be run.
Definition: cover_instrument.h:102