Module Mlang.Bir_instrumentation

Code coverage for a single run

module CodeLocationMap : MapExt.T with type T.key = Bir_interpreter.code_location
type code_coverage_result = Bir_interpreter.var_literal CodeLocationMap.t Mlang.Bir.VariableMap.t

For each variable, and for each code location where it is assigned, we record the value it has been assigned to during an interpreter run

val empty_code_coverage_result : code_coverage_result
val code_coverage_init : unit -> unit
val code_coverage_result : unit -> code_coverage_result

Code coverage for multiple runs

module VarLiteralSet : SetExt.T with type T.elt = Bir_interpreter.var_literal
type code_coverage_map_value = VarLiteralSet.t
type code_coverage_acc = code_coverage_map_value CodeLocationMap.t Mlang.Bir.VariableMap.t

The accumulated coverage is the set of distinct values a particular variable assignment has received in the tests runs so far

val merge_code_coverage_single_results_with_acc : code_coverage_result -> code_coverage_acc -> code_coverage_acc

merge_code_coverage_single_results_with_acc result acc merges the code coverage results of a single run result with the accumulated results over the tests so far acc

val merge_code_coverage_acc : code_coverage_acc -> code_coverage_acc -> code_coverage_acc

Merges two partial code coverage accumulator into a single, bigger one

Code locations

type code_locs = Bir.variable CodeLocationMap.t
val get_code_locs : Bir.program -> code_locs

Returns all code locations in a program