cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
symex_coverage.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Record and print code coverage of symbolic execution
4
5
Author: Michael Tautschnig
6
7
Date: March 2016
8
9
\*******************************************************************/
10
13
14
#ifndef CPROVER_CBMC_SYMEX_COVERAGE_H
15
#define CPROVER_CBMC_SYMEX_COVERAGE_H
16
17
#include <iosfwd>
18
#include <map>
19
#include <string>
20
21
#include <
goto-programs/goto_program.h
>
22
23
class
coverage_recordt
;
24
class
goto_functionst
;
25
class
namespacet
;
26
class
xmlt
;
27
28
class
symex_coveraget
29
{
30
public
:
31
explicit
symex_coveraget
(
const
namespacet
&_ns) :
ns
(_ns)
32
{
33
}
34
35
void
36
covered
(
goto_programt::const_targett
from,
goto_programt::const_targett
to)
37
{
38
std::pair<coverage_innert::iterator, bool> entry =
39
coverage
[from].insert({to,
coverage_infot
(from, to, 1)});
40
41
if
(!entry.second)
42
++(entry.first->second.num_executions);
43
}
44
45
bool
generate_report
(
46
const
goto_functionst
&goto_functions,
47
const
std::string &path)
const
;
48
49
protected
:
50
const
namespacet
&
ns
;
51
52
struct
coverage_infot
53
{
54
coverage_infot
(
55
goto_programt::const_targett
_from,
56
goto_programt::const_targett
_to,
57
unsigned
_num_executions)
58
:
location
(_from),
num_executions
(_num_executions),
succ
(_to)
59
{
60
}
61
62
goto_programt::const_targett
location
;
63
unsigned
num_executions
;
64
goto_programt::const_targett
succ
;
65
};
66
67
typedef
std::map<
68
goto_programt::const_targett
,
69
coverage_infot
,
70
goto_programt::target_less_than
>
71
coverage_innert
;
72
typedef
std::map<
73
goto_programt::const_targett
,
74
coverage_innert
,
75
goto_programt::target_less_than
>
76
coveraget
;
77
coveraget
coverage
;
78
79
bool
80
output_report
(
const
goto_functionst
&goto_functions, std::ostream &os)
const
;
81
82
void
build_cobertura
(
83
const
goto_functionst
&goto_functions,
84
xmlt
&xml_coverage)
const
;
85
86
void
compute_overall_coverage
(
87
const
goto_functionst
&goto_functions,
88
coverage_recordt
&dest)
const
;
89
90
friend
class
goto_program_coverage_recordt
;
91
};
92
93
#endif
// CPROVER_CBMC_SYMEX_COVERAGE_H
coverage_recordt
Definition
symex_coverage.cpp:32
goto_functionst
A collection of goto functions.
Definition
goto_functions.h:25
goto_programt::const_targett
instructionst::const_iterator const_targett
Definition
goto_program.h:614
goto_programt::target_less_than
instructiont::target_less_than target_less_than
Definition
goto_program.h:618
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
symex_coveraget::covered
void covered(goto_programt::const_targett from, goto_programt::const_targett to)
Definition
symex_coverage.h:36
symex_coveraget::symex_coveraget
symex_coveraget(const namespacet &_ns)
Definition
symex_coverage.h:31
symex_coveraget::compute_overall_coverage
void compute_overall_coverage(const goto_functionst &goto_functions, coverage_recordt &dest) const
Definition
symex_coverage.cpp:292
symex_coveraget::generate_report
bool generate_report(const goto_functionst &goto_functions, const std::string &path) const
Definition
symex_coverage.cpp:428
symex_coveraget::coverage_innert
std::map< goto_programt::const_targett, coverage_infot, goto_programt::target_less_than > coverage_innert
Definition
symex_coverage.h:71
symex_coveraget::output_report
bool output_report(const goto_functionst &goto_functions, std::ostream &os) const
Definition
symex_coverage.cpp:413
symex_coveraget::goto_program_coverage_recordt
friend class goto_program_coverage_recordt
Definition
symex_coverage.h:90
symex_coveraget::build_cobertura
void build_cobertura(const goto_functionst &goto_functions, xmlt &xml_coverage) const
Definition
symex_coverage.cpp:369
symex_coveraget::ns
const namespacet & ns
Definition
symex_coverage.h:50
symex_coveraget::coverage
coveraget coverage
Definition
symex_coverage.h:77
symex_coveraget::coveraget
std::map< goto_programt::const_targett, coverage_innert, goto_programt::target_less_than > coveraget
Definition
symex_coverage.h:76
xmlt
Definition
xml.h:21
goto_program.h
Concrete Goto Program.
symex_coveraget::coverage_infot
Definition
symex_coverage.h:53
symex_coveraget::coverage_infot::location
goto_programt::const_targett location
Definition
symex_coverage.h:62
symex_coveraget::coverage_infot::succ
goto_programt::const_targett succ
Definition
symex_coverage.h:64
symex_coveraget::coverage_infot::coverage_infot
coverage_infot(goto_programt::const_targett _from, goto_programt::const_targett _to, unsigned _num_executions)
Definition
symex_coverage.h:54
symex_coveraget::coverage_infot::num_executions
unsigned num_executions
Definition
symex_coverage.h:63
goto-checker
symex_coverage.h
Generated by
1.17.0