cprover
cover.h File Reference
#include "cover_filter.h"
#include "cover_instrument.h"
#include "util/make_unique.h"
+ Include dependency graph for cover.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cover_configt
 

Enumerations

enum  coverage_criteriont {
  coverage_criteriont::LOCATION, coverage_criteriont::BRANCH, coverage_criteriont::DECISION, coverage_criteriont::CONDITION,
  coverage_criteriont::PATH, coverage_criteriont::MCDC, coverage_criteriont::ASSERTION, coverage_criteriont::COVER
}
 

Functions

void instrument_cover_goals (const symbol_tablet &, const cover_configt &, goto_functionst &, coverage_criteriont, message_handlert &message_handler)
 
void instrument_cover_goals (const symbol_tablet &, const cover_configt &, goto_programt &, coverage_criteriont, message_handlert &message_handler)
 
cover_configt get_cover_config (const optionst &, const symbol_tablet &, message_handlert &)
 Build data structures controlling coverage from command-line options. More...
 
cover_configt get_cover_config (const optionst &, const irep_idt &main_function_id, const symbol_tablet &, message_handlert &)
 Build data structures controlling coverage from command-line options. More...
 
void instrument_cover_goals (const cover_configt &, goto_model_functiont &, message_handlert &)
 Instruments a single goto program based on the given configuration. More...
 
void parse_cover_options (const cmdlinet &, optionst &)
 Parses coverage-related command line options. More...
 
bool instrument_cover_goals (const cover_configt &, const symbol_tablet &, goto_functionst &, message_handlert &)
 Instruments goto functions based on given command line options. More...
 
bool instrument_cover_goals (const cover_configt &, goto_modelt &, message_handlert &)
 Instruments a goto model based on given command line options. More...
 

Detailed Description

Coverage Instrumentation

Definition in file cover.h.

Enumeration Type Documentation

◆ coverage_criteriont

enum coverage_criteriont
strong
Enumerator
LOCATION 
BRANCH 
DECISION 
CONDITION 
PATH 
MCDC 
ASSERTION 
COVER 

Definition at line 25 of file cover.h.

Function Documentation

◆ get_cover_config() [1/2]

cover_configt get_cover_config ( const optionst options,
const irep_idt main_function_id,
const symbol_tablet symbol_table,
message_handlert message_handler 
)

Build data structures controlling coverage from command-line options.

Include options that depend on the main function specified by the user.

Parameters
optionscommand-line options
main_function_idsymbol of the user-specified main program function
symbol_tableglobal symbol table
message_handlerused to log incorrect option specifications
Returns
a cover_configt on success, or null otherwise.

Definition at line 239 of file cover.cpp.

◆ get_cover_config() [2/2]

cover_configt get_cover_config ( const optionst options,
const symbol_tablet symbol_table,
message_handlert message_handler 
)

Build data structures controlling coverage from command-line options.

Do not include the options that depend on the main function specified by the user.

Parameters
optionscommand-line options
symbol_tableglobal symbol table
message_handlerused to log incorrect option specifications
Returns
a cover_configt on success, or null otherwise.

Definition at line 176 of file cover.cpp.

◆ instrument_cover_goals() [1/5]

bool instrument_cover_goals ( const cover_configt cover_config,
const symbol_tablet symbol_table,
goto_functionst goto_functions,
message_handlert message_handler 
)

Instruments goto functions based on given command line options.

Parameters
cover_configconfiguration, produced using get_cover_config
symbol_tablethe symbol table
goto_functionsthe goto functions
message_handlera message handler

Definition at line 360 of file cover.cpp.

◆ instrument_cover_goals() [2/5]

void instrument_cover_goals ( const cover_configt cover_config,
goto_model_functiont function,
message_handlert message_handler 
)

Instruments a single goto program based on the given configuration.

Parameters
cover_configconfiguration, produced using get_cover_config
functiongoto program to instrument
message_handlerlog output

Definition at line 339 of file cover.cpp.

◆ instrument_cover_goals() [3/5]

bool instrument_cover_goals ( const cover_configt cover_config,
goto_modelt goto_model,
message_handlert message_handler 
)

Instruments a goto model based on given command line options.

Parameters
cover_configconfiguration, produced using get_cover_config
goto_modelthe goto model
message_handlera message handler

Definition at line 397 of file cover.cpp.

◆ instrument_cover_goals() [4/5]

void instrument_cover_goals ( const symbol_tablet ,
const cover_configt ,
goto_functionst ,
coverage_criteriont  ,
message_handlert message_handler 
)

◆ instrument_cover_goals() [5/5]

void instrument_cover_goals ( const symbol_tablet ,
const cover_configt ,
goto_programt ,
coverage_criteriont  ,
message_handlert message_handler 
)

◆ parse_cover_options()

void parse_cover_options ( const cmdlinet cmdline,
optionst options 
)

Parses coverage-related command line options.

Parameters
cmdlinethe command line
optionsthe options

Definition at line 142 of file cover.cpp.