coveralls-lcov 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b2c04147631c43abdc8c0eff92c15bcd118cd05
4
- data.tar.gz: 72c0721084964ad7c380cfc5f4872ea44cbf14e5
3
+ metadata.gz: 55af10a66b7405fe018749cb47973aa42df67d86
4
+ data.tar.gz: 575ff56f720f96fba946c4307d614c26f6504916
5
5
  SHA512:
6
- metadata.gz: '0177944b7ec84cbb52de8d272cd97c04acc7893bf6d1f2351d597907fc5c87f01d160345523d095323a25b7a91e886cc65bc7d7b9d5928e212efd14f6a0f567b'
7
- data.tar.gz: ddd589fe492275b0ec6d4558a916b8f8bc2de542fcd626b758858efa7dcc18386dba6138129d126d7f3f749a58583a5b0956302529497bb58a2e8dfafcfece31
6
+ metadata.gz: 66337291792604ee5cf2fdf9bfb704dfafeb58d09967410869666395687144a2c63673198fde3734d41c51bdb354c0aaa903e46747dd1dbfc1daf05b804ec8dc
7
+ data.tar.gz: f65d4706e225440aaedc79eaa338fb27b4cf8430e812d69e997de7db4ecf03b63f9b76c51d832650f94a55fc0fab033caf672e0e3249073da47f716935a28842
@@ -25,7 +25,7 @@ module Coveralls
25
25
  end
26
26
 
27
27
  def parse_tracefile
28
- lcov_info = Hash.new {|h, k| h[k] = { "coverage" => {}, "branches" => [] } }
28
+ lcov_info = Hash.new {|h, k| h[k] = { "coverage" => {}, "branches" => {} } }
29
29
  source_file = nil
30
30
  File.readlines(@tracefile).each do |line|
31
31
  case line.chomp
@@ -34,7 +34,8 @@ module Coveralls
34
34
  when /\ADA:(\d+),(\d+)/
35
35
  line_no = $1.to_i
36
36
  count = $2.to_i
37
- lcov_info[source_file]["coverage"][line_no] = count
37
+ coverage = lcov_info[source_file]["coverage"]
38
+ coverage[line_no] = (coverage[line_no] || 0) + count
38
39
  when /\ABRDA:(\d+),(\d+),(\d+),(\d+|-)/
39
40
  line_no = $1.to_i
40
41
  block_no = $2.to_i
@@ -43,7 +44,10 @@ module Coveralls
43
44
  unless $4 == "-"
44
45
  hits = $4.to_i
45
46
  end
46
- lcov_info[source_file]['branches'].push(line_no, block_no, branch_no, hits)
47
+ branches = lcov_info[source_file]['branches']
48
+ branches_line = branches[line_no] = branches[line_no] || {}
49
+ branches_block = branches_line[block_no] = branches_line[block_no] || {}
50
+ branches_block[branch_no] = (branches_block[branch_no] || 0) + hits
47
51
  when /\Aend_of_record/
48
52
  source_file = nil
49
53
  end
@@ -69,7 +73,15 @@ module Coveralls
69
73
  coverage: coverage,
70
74
  }
71
75
  unless info["branches"].empty?
72
- source_file["branches"] = info["branches"]
76
+ branches = []
77
+ info["branches"].each do |line_no, blocks_no|
78
+ blocks_no.each do |block_no, branches_no|
79
+ branches_no.each do |branch_no, hits|
80
+ branches.push(line_no, block_no, branch_no, hits)
81
+ end
82
+ end
83
+ end
84
+ source_file["branches"] = branches
73
85
  end
74
86
  source_file
75
87
  end
@@ -1,5 +1,5 @@
1
1
  module Coveralls
2
2
  module Lcov
3
- VERSION = "1.5.0"
3
+ VERSION = "1.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls-lcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Okimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-29 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.6.11
80
+ rubygems_version: 2.6.13
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Post coverage information to coveralls.io