gcov2x 0.5.0 → 0.5.1
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 +4 -4
- data/bin/gcov2x +5 -0
- data/lib/file.rb +4 -2
- data/lib/project.rb +10 -14
- data/lib/version.rb +1 -1
- data/spec/gcov2x/project_spec.rb +50 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc193fe4a3be29c0863a092df1ada25ab1ffb660
|
4
|
+
data.tar.gz: 5608d02ef2b141296b09cf08de5b7bc76473d8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb6c7cf682665c724e8d1dfd273990dbd14e7a3fc9b296f56bd8e644cece9363f6e7d694b9314f14b6bd2961ae9014f1e43e2cbc2d0cd69584cacc8890a123da
|
7
|
+
data.tar.gz: d2be48bb64447d436613d47ad06a3088e3a39a8b1633cbb7276d8ab78735e1f9852cc0f2512ce481d26d9b27bf25ab802d00aab3e49e4f70a54fc69308dfcbc3
|
data/bin/gcov2x
CHANGED
@@ -7,6 +7,7 @@ require_relative '../lib/ansii_formatter'
|
|
7
7
|
require_relative '../lib/xml_formatter'
|
8
8
|
require_relative '../lib/html_formatter'
|
9
9
|
require_relative '../lib/json_formatter'
|
10
|
+
require_relative '../lib/version'
|
10
11
|
|
11
12
|
class Util
|
12
13
|
def Util.opt_wrap(s, width=61)
|
@@ -17,6 +18,10 @@ end
|
|
17
18
|
class CGOV_CLI
|
18
19
|
include Mixlib::CLI
|
19
20
|
|
21
|
+
banner "gcov2x v#{GCOV::VERSION}
|
22
|
+
|
23
|
+
Usage:"
|
24
|
+
|
20
25
|
option :filter,
|
21
26
|
:long => "--filter FILTER",
|
22
27
|
:description => Util.opt_wrap("A semicolon-separated list of regex filters which specify which files NOT to include in the conversion. Will filter on the actual filename (replacing any mangling done by llvm-cov using #'s) as well as the 'Source' meta attribute in the GCOV data.
|
data/lib/file.rb
CHANGED
data/lib/project.rb
CHANGED
@@ -81,28 +81,24 @@ module GCOV
|
|
81
81
|
hash[:filter] = [ hash[:filter] ]
|
82
82
|
end
|
83
83
|
|
84
|
-
filenames.
|
85
|
-
hash[:filter].nil? or hash[:filter].empty? or hash[:filter].select{|f| f.match(GCOV::File.demangle(filename) ) }.empty?
|
86
|
-
}.map{|filename| GCOV::File.load filename }.each do |files|
|
84
|
+
filenames.map{|filename| GCOV::File.load filename }.each do |files|
|
87
85
|
files.each do |file|
|
88
86
|
if hash[:filter].nil? or hash[:filter].empty? or hash[:filter].select{|f| f.match(::Pathname.new(file.meta['Source']).cleanpath.to_s) }.empty?
|
89
87
|
self << file
|
90
88
|
end # if
|
91
89
|
end # each file
|
92
|
-
end # each
|
93
|
-
end
|
94
|
-
end
|
90
|
+
end # each files
|
91
|
+
end # add_files
|
92
|
+
end # #add_dir
|
95
93
|
|
96
94
|
def add_file path, hash={}
|
97
95
|
add_files do
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
end
|
105
|
-
end # if
|
96
|
+
files = GCOV::File.load(path)
|
97
|
+
files.each do |file|
|
98
|
+
if hash[:filter].nil? or hash[:filter].empty? or hash[:filter].select{|f| f.match(::Pathname.new(file.meta['Source']).cleanpath.to_s) }.empty?
|
99
|
+
self << file
|
100
|
+
end # if
|
101
|
+
end # each file
|
106
102
|
end # add_files
|
107
103
|
end # add_file
|
108
104
|
|
data/lib/version.rb
CHANGED
data/spec/gcov2x/project_spec.rb
CHANGED
@@ -58,7 +58,39 @@ describe GCOV::Project do
|
|
58
58
|
it "adds the given file" do
|
59
59
|
project = GCOV::Project.new
|
60
60
|
project.add_file(File.join(File.dirname(__FILE__),"data","test2.cpp.gcov"))
|
61
|
-
expect(project.files.
|
61
|
+
expect(project.files.count).to eq(1)
|
62
|
+
expect(project.files[0].name).to eq( "test2.cpp" )
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should split concatenated gcov files into multiple objects" do
|
66
|
+
project = GCOV::Project.new
|
67
|
+
project.add_file(File.join(File.dirname(__FILE__),"concat","test_cat.cpp.gcov"))
|
68
|
+
expect(project.files.count).to eq(2)
|
69
|
+
expect(project.files.map(&:name)).to include( "test.cpp" )
|
70
|
+
expect(project.files.map(&:name)).to include( "test1.cpp" )
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
it "should filter using given array of expressions" do
|
75
|
+
project = GCOV::Project.new
|
76
|
+
project.add_file(File.join(File.dirname(__FILE__),"data","test2.cpp.gcov"), :filter => [/test2\.cpp/,/test3\.cpp/])
|
77
|
+
expect(project.files.count).to eq(0)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should filter out concatenated files that match the filter" do
|
81
|
+
project = GCOV::Project.new
|
82
|
+
project.add_file(File.join(File.dirname(__FILE__),"concat","test_cat.cpp.gcov"), :filter => [/test\.cpp$/])
|
83
|
+
expect(project.files.count).to eq(1)
|
84
|
+
expect(project.files.map(&:name)).not_to include( a_string_ending_with("test.cpp") )
|
85
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test1.cpp") )
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should not filter out concatenated files that don't match the filter" do
|
89
|
+
project = GCOV::Project.new
|
90
|
+
project.add_file(File.join(File.dirname(__FILE__),"concat","test_cat.cpp.gcov"), :filter => [/test_cat\.cpp\.gcov$/])
|
91
|
+
expect(project.files.count).to eq(2)
|
92
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test.cpp") )
|
93
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test1.cpp") )
|
62
94
|
end
|
63
95
|
end
|
64
96
|
|
@@ -94,6 +126,23 @@ describe GCOV::Project do
|
|
94
126
|
expect(project.files.map{|file|file.name}).not_to include( a_string_ending_with("test2.cpp") )
|
95
127
|
expect(project.files.map{|file|file.name}).not_to include( a_string_ending_with("test3.cpp") )
|
96
128
|
end
|
129
|
+
|
130
|
+
it "should filter out concatenated files that match the filter" do
|
131
|
+
project = GCOV::Project.new
|
132
|
+
project.add_dir(File.join(File.dirname(__FILE__),"concat"), :recursive => true, :filter => [/test\.cpp$/])
|
133
|
+
expect(project.files.count).to eq(1)
|
134
|
+
expect(project.files.map(&:name)).not_to include( a_string_ending_with("test.cpp") )
|
135
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test1.cpp") )
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should not filter out concatenated files that don't match the filter" do
|
139
|
+
project = GCOV::Project.new
|
140
|
+
project.add_dir(File.join(File.dirname(__FILE__),"concat"), :recursive => true, :filter => [/test_cat\.cpp/])
|
141
|
+
expect(project.files.count).to eq(2)
|
142
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test.cpp") )
|
143
|
+
expect(project.files.map(&:name)).to include( a_string_ending_with("test1.cpp") )
|
144
|
+
end
|
145
|
+
|
97
146
|
end
|
98
147
|
|
99
148
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcov2x
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattias Bergbom
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
187
|
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.2.0
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: gcov parser and formatter
|