coveralls-lcov 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57aef8819d19e7a9b14c0f224f1517599abc9689
4
- data.tar.gz: 644a69e16c1d1080f69cb9cecbc926855e6124b3
3
+ metadata.gz: 1b2c04147631c43abdc8c0eff92c15bcd118cd05
4
+ data.tar.gz: 72c0721084964ad7c380cfc5f4872ea44cbf14e5
5
5
  SHA512:
6
- metadata.gz: 00e74ee6fb1e2a8c89399841674165c59ec9ad7fe46de350032e2f6a4d909a48811754f9362a591fc9896aa270c5c605ea60919d28df75408e33bd9d41dca67a
7
- data.tar.gz: 8fcc5b3af413baab83eb92ca6041fcc00ecd65af77384802c8c87b20f3a84ddfb8511b7a74215210527a77d683186d4588caf5ebcc18b3f8ede171da8fc127ce
6
+ metadata.gz: '0177944b7ec84cbb52de8d272cd97c04acc7893bf6d1f2351d597907fc5c87f01d160345523d095323a25b7a91e886cc65bc7d7b9d5928e212efd14f6a0f567b'
7
+ data.tar.gz: ddd589fe492275b0ec6d4558a916b8f8bc2de542fcd626b758858efa7dcc18386dba6138129d126d7f3f749a58583a5b0956302529497bb58a2e8dfafcfece31
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Upload coverage information generated by LCOV to coveralls.io.
4
4
 
5
- coveralls-lcov supports travis-ci.org only.
5
+ coveralls-lcov supports travis-ci.org and travis-ci.com (via the `--service-name` switch).
6
6
 
7
7
  ## Installation
8
8
 
@@ -18,13 +18,17 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install coveralls-lcov
20
20
 
21
+ Alternatively if you want to install your own build of `coveralls-lcov` system-wide (one-step installation):
22
+
23
+ $ sudo rake install
24
+
21
25
  ## Usage
22
26
 
23
27
  In .travis.yml
24
28
 
25
29
  Do not use `sudo` when install Gem because `sudo` doesn't refer PATH changed by RVM.
26
30
 
27
- ```
31
+ ```yaml
28
32
  install:
29
33
  - sudo apt-get install -y lcov
30
34
  - gem install coveralls-lcov
@@ -44,9 +48,33 @@ or by hand
44
48
  $ coveralls-lcov --repo-token "YOUR TOKEN" coverage.info
45
49
  ```
46
50
 
51
+ you can also put the token into the config file `.coveralls.yml` like this
52
+
53
+ ```yaml
54
+ repo_token: abcd....
55
+ ```
56
+
57
+ and then execute
58
+
59
+ ```
60
+ $ coveralls-lcov coverage.info
61
+ ```
62
+
63
+ ### C1 coverage support
64
+
65
+ You can report C1 coverage using `--rc lcov_branch_coverage=1`.
66
+
67
+ ```yaml
68
+ after_success:
69
+ - lcov --compat-libtool --directory . --capture --rc lcov_branch_coverage=1 --output-file coverage.info
70
+ - coveralls-lcov coverage.info
71
+ ```
72
+
73
+ See also lcovrc(5).
74
+
47
75
  ## Contributing
48
76
 
49
- 1. Fork it ( http://github.com/<my-github-username>/coveralls-lcov/fork )
77
+ 1. Fork it ( http://github.com/okkez/coveralls-lcov/fork )
50
78
  2. Create your feature branch (`git checkout -b my-new-feature`)
51
79
  3. Commit your changes (`git commit -am 'Add some feature'`)
52
80
  4. Push to the branch (`git push origin my-new-feature`)
@@ -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] = {} }
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,16 @@ 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][line_no] = count
37
+ lcov_info[source_file]["coverage"][line_no] = count
38
+ when /\ABRDA:(\d+),(\d+),(\d+),(\d+|-)/
39
+ line_no = $1.to_i
40
+ block_no = $2.to_i
41
+ branch_no = $3.to_i
42
+ hits = 0
43
+ unless $4 == "-"
44
+ hits = $4.to_i
45
+ end
46
+ lcov_info[source_file]['branches'].push(line_no, block_no, branch_no, hits)
38
47
  when /\Aend_of_record/
39
48
  source_file = nil
40
49
  end
@@ -51,14 +60,18 @@ module Coveralls
51
60
  lines = source.lines
52
61
  coverage = Array.new(lines.to_a.size)
53
62
  source.lines.each_with_index do |_line, index|
54
- coverage[index] = info[index + 1]
63
+ coverage[index] = info["coverage"][index + 1]
55
64
  end
56
65
  top_src_dir = Dir.pwd
57
- {
66
+ source_file = {
58
67
  name: filename.sub(%r!#{top_src_dir}/!, ""),
59
68
  source: source,
60
69
  coverage: coverage,
61
70
  }
71
+ unless info["branches"].empty?
72
+ source_file["branches"] = info["branches"]
73
+ end
74
+ source_file
62
75
  end
63
76
 
64
77
  def git_info
@@ -1,5 +1,5 @@
1
1
  module Coveralls
2
2
  module Lcov
3
- VERSION = "1.4.0"
3
+ VERSION = "1.5.0"
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.4.0
4
+ version: 1.5.0
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-09 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler