gcovtools 1.0.3 → 1.1.0

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: e07b922b023c0baf5d26b85cf5b6b8f3706fe325
4
- data.tar.gz: c3d1c5c153de0cd4341da4c480fd6f498e1f240b
3
+ metadata.gz: 8ff206b6aa6e1b572ba0c6132b07b98ec02dfc9e
4
+ data.tar.gz: 5ae22b704552ed6a1e3b8bc12fe26dab8c753257
5
5
  SHA512:
6
- metadata.gz: 5c16b46f12bd8e24f92f4651189e490fc2bc899d1bea0c27efc58615ecb4d873687dbd82dbba699a00f1b19bce2cfcbfc3016033a3f3b71bf9a7939ba55a7301
7
- data.tar.gz: 764f90af7e67cb64b402d168644fff988145530fd534dfce32ce2b5a6e3c1ca050365d1395e6f831ceb46f115a7f8c69e981c5512be3a80a514b82b4e33cdc0e
6
+ metadata.gz: 2f10851c0e8c054459c838b002fc98cd42c381b67415d14aaeab2bf434f7d5952ae56feebfe00644f1ad5dfdcad0914c6648a58b2e6574a603caf431ad703fe3
7
+ data.tar.gz: 71f141bd8affacf8a8233cc4212f44a80d8e9c4c47725645822fc621e824fad7a42a9df6eb63cf9d7f92b3b39716ccf3e24b1796921c7f1c5fc5e460412de6e2
data/lib/line.rb CHANGED
@@ -29,6 +29,7 @@ module GCOVTOOLS
29
29
  when "#####" then :missed
30
30
  else count.to_i
31
31
  end
32
+ count = :none if count == :missed and text.strip == "}"
32
33
  GCOVTOOLS::Line.new number,count,text
33
34
  end
34
35
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GCOVTOOLS
2
- VERSION = '1.0.3'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -2,46 +2,65 @@ require_relative '../spec_helper'
2
2
 
3
3
  describe GCOVTOOLS::Line do
4
4
  describe "#number" do
5
- it "returns the number it was given" do
5
+ it "should return the number it was given" do
6
6
  line = GCOVTOOLS::Line.new 2, 4, "abcdef"
7
7
  expect(line.number).to eq(2)
8
8
  end
9
9
  end
10
10
 
11
11
  describe "#count" do
12
- it "returns the count it was given" do
12
+ it "should return the count it was given" do
13
13
  line = GCOVTOOLS::Line.new 2, 4, "abcdef"
14
14
  expect(line.count).to eq(4)
15
15
  end
16
16
  end
17
17
 
18
18
  describe "#text" do
19
- it "returns the text it was given" do
19
+ it "should return the text it was given" do
20
20
  line = GCOVTOOLS::Line.new 2, 4, "abcdef"
21
21
  expect(line.text).to eq("abcdef")
22
22
  end
23
23
  end
24
24
 
25
25
  describe ".parse" do
26
- it "parses gcov format line with count" do
26
+ it "should parse gcov format line with count" do
27
27
  line = GCOVTOOLS::Line.parse " 2: 55: std::string StringUtil::ltrim( const std::string &s ) "
28
28
  expect(line.number).to eq(55)
29
29
  expect(line.count).to eq(2)
30
30
  expect(line.text).to eq(" std::string StringUtil::ltrim( const std::string &s ) ")
31
31
  end
32
32
 
33
- it "parses empty gcov format line" do
33
+ it "should parse empty gcov format line" do
34
34
  line = GCOVTOOLS::Line.parse " -: 35: * don't worry about excessive copying."
35
35
  expect(line.number).to eq(35)
36
36
  expect(line.count).to eq(:none)
37
37
  expect(line.text).to eq(" * don't worry about excessive copying.")
38
38
  end
39
39
 
40
- it "parses missed gcov format line" do
41
- line = GCOVTOOLS::Line.parse " #####: 89: } "
40
+ it "should parse missed gcov format line" do
41
+ line = GCOVTOOLS::Line.parse " #####: 89: int somestatement = /*ignored value*/ xyz; } "
42
42
  expect(line.number).to eq(89)
43
43
  expect(line.count).to eq(:missed)
44
- expect(line.text).to eq(" } ")
44
+ expect(line.text).to eq(" int somestatement = /*ignored value*/ xyz; } ")
45
+ end
46
+
47
+ it "should ignore missed closing brace" do
48
+ line = GCOVTOOLS::Line.parse " #####: 1:}"
49
+ expect(line.number).to eq(1)
50
+ expect(line.count).to eq(:none)
51
+ expect(line.text).to eq("}")
52
+ line = GCOVTOOLS::Line.parse " #####: 89: } "
53
+ expect(line.number).to eq(89)
54
+ expect(line.count).to eq(:none)
55
+ expect(line.text).to eq(" } ")
56
+ line = GCOVTOOLS::Line.parse " #####: 999: }"
57
+ expect(line.number).to eq(999)
58
+ expect(line.count).to eq(:none)
59
+ expect(line.text).to eq(" }")
60
+ line = GCOVTOOLS::Line.parse " #####: 5:} "
61
+ expect(line.number).to eq(5)
62
+ expect(line.count).to eq(:none)
63
+ expect(line.text).to eq("} ")
45
64
  end
46
65
 
47
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcovtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattias Bergbom