View Source LcovEx.Stats (lcov_ex v0.3.3)

Output parser for :cover.analyse/3

Link to this section Summary

Functions

Function coverage data parser. Discards BEAM file :__info__/1 function data.

Function coverage data parser. Discards BEAM file line 0 data.

Link to this section Types

Link to this type

cover_analyze_function_output()

View Source
@type cover_analyze_function_output() :: [
  {{module(), atom(), integer()}, integer()},
  ...
]
Link to this type

cover_analyze_line_output()

View Source
@type cover_analyze_line_output() :: [{{module(), integer()}, integer()}, ...]
@type coverage_info() :: {binary(), integer()}

Link to this section Functions

Link to this function

function_coverage_data(fun_data)

View Source
@spec function_coverage_data(cover_analyze_function_output()) ::
  {[coverage_info(), ...], %{fnf: integer(), fnh: integer()}}

Function coverage data parser. Discards BEAM file :__info__/1 function data.

examples

Examples

iex> LcovEx.Stats.function_coverage_data([{{MyModule, :__info__, 1}, 3}, {{MyModule, :foo, 2}, 0}])
{[{"foo/2", 0}], %{fnf: 1, fnh: 0}}
Link to this function

line_coverage_data(lines_data)

View Source
@spec line_coverage_data(cover_analyze_line_output()) ::
  {[coverage_info(), ...], %{lf: integer(), lh: integer()}}

Function coverage data parser. Discards BEAM file line 0 data.

examples

Examples

iex> LcovEx.Stats.line_coverage_data([{{MyModule, 0}, 3}, {{MyModule, 0}, 0}, {{MyModule, 8}, 0}])
{[{8, 0}], %{lf: 1, lh: 0}}

iex> LcovEx.Stats.line_coverage_data([{{MyModule, 1}, 12}, {{MyModule, 1}, 0}, {{MyModule, 2}, 0}])
{[{1, 12}, {2, 0}], %{lf: 2, lh: 1}}