Class: Report::LCov

Inherits:
Object
  • Object
show all
Defined in:
lib/report/lcov.rb

Overview

TN: -> start of record SF: -> file path FN: -> function declaration (line#,func_name) FNDA: function coverage (count,func_name) BRDA: branch coverage (line#,block#,branch#,count) count = - for none DA: line coverage LF: statements LH: statements covered FNF: functions FNH: functions covered BRF: branches / conditionals BRH: branches / conditions covered end_of_record: -> end of record

Instance Method Summary collapse

Instance Method Details

#translate(doc) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/report/lcov.rb', line 15

def translate(doc)
  files(doc).reduce({}) do |acc, file|
    file.shift()

    lines = lines(file)
    branches = branches(file)

    path = file.first[3..-1]
    acc[path] = {lines: merge(lines, branches)}

    acc
  end
end