Shared_ast.CoverageSourceMore efficient File map module
A position can either be Unreached or Reached_by a set of test scopes.
val reached_pos :
Catala_utils.Pos.t ->
Shared_ast__.Definitions.ScopeName.t ->
coverage_map ->
coverage_mapreached_pos p s m marks the position p as reached by the scope s in the map m. Merge scopes if the position was already reached by another scope.
unreached_pos p m marks the position p as unreached in the map m. Does not overwrite the existing cover.
val reachable_positions :
((_, _, _) Shared_ast__.Definitions.base_gexpr,
_ Shared_ast__.Definitions.mark)
Catala_utils.Mark.ed
Shared_ast__.Definitions.program ->
coverage_mapreachable_positions prg iterates over the program p's expressions to build a Unreached only coverage_map.
val merge_with_reachable_positions :
reachable:coverage_map ->
reached:coverage_map ->
coverage_mapmerge_with_reachable_positions ~reachable ~reached computes the union between reachable and reached but filter out files that do not contain reached positions. When a conflict occurs, the cover are merged, i.e., scopes are merged together.
filter_files p m removes the files from the coverage map that do not satisfy the predicate p. Used to filter out the stdlib.
Marshal the coverage map and prints it as hexadecimal.
Unmarshal the coverage map from an hexadecimal string.
n-ary tree that modelize the coverage of a file. Every node's sub-trees are comprised in their parent wrt. their interval. This is the structure that should be exported.
Build and normalize a coverage map into an interval tree.
all_scopes itvt iterates over the interval tree itvt and returns the union of all scopes that produced a Reached_by cover.