xcov 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcov-core/bin/xcov-core +0 -0
- data/lib/xcov-core/version.rb +1 -1
- data/lib/xcov/manager.rb +54 -15
- data/lib/xcov/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b96135c42bcad3bc99bd0a7bd8a703311df3455e99c8c3b303bc20b7b43d1fe
|
4
|
+
data.tar.gz: af66a0c17ae43ced2ddce57187c7baf9764e48d90f2c9836f01e371a11265adb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ecbcbdd82fd7abaef6c34c2f7631ca88af1482d77c85074e2a6e7c07bce6fab54dc25bddaf7c676794e8203bf4fe8937b4ee03449577926eb03d11a96f422da
|
7
|
+
data.tar.gz: b185daa8cb390aab36b322bb8b127668f036a0ebba509d43aa43c1ae8228845e54e69a18e6fa1bd207470c2e9a0f5d39c52005982404b2ace02364a85d3564d6
|
data/lib/xcov-core/bin/xcov-core
CHANGED
Binary file
|
data/lib/xcov-core/version.rb
CHANGED
data/lib/xcov/manager.rb
CHANGED
@@ -38,6 +38,11 @@ module Xcov
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def parse_xccoverage
|
41
|
+
xccoverage_files = []
|
42
|
+
|
43
|
+
# xcresults to parse and export after collecting
|
44
|
+
xcresults_to_parse_and_export = []
|
45
|
+
|
41
46
|
# Find .xccoverage file
|
42
47
|
# If no xccov direct path, use the old derived data path method
|
43
48
|
if xccov_file_direct_paths.nil?
|
@@ -48,17 +53,36 @@ module Xcov
|
|
48
53
|
if xccoverage_files.empty?
|
49
54
|
xcresult_paths = Dir["#{test_logs_path}*.xcresult"].sort_by { |filename| File.mtime(filename) }.reverse
|
50
55
|
xcresult_paths.each do |xcresult_path|
|
51
|
-
|
56
|
+
xcresults_to_parse_and_export << xcresult_path
|
52
57
|
end
|
53
58
|
end
|
54
59
|
|
55
|
-
unless test_logs_path.directory?
|
60
|
+
unless test_logs_path.directory?
|
56
61
|
ErrorHandler.handle_error("XccoverageFileNotFound")
|
57
62
|
end
|
58
63
|
else
|
59
|
-
|
64
|
+
# Iterate over direct paths and find .xcresult files
|
65
|
+
# that need to be processed before getting coverage
|
66
|
+
xccov_file_direct_paths.each do |path|
|
67
|
+
if File.extname(path) == '.xcresult'
|
68
|
+
xcresults_to_parse_and_export << path
|
69
|
+
else
|
70
|
+
xccoverage_files << path
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Iterates over xcresults
|
76
|
+
# Exports .xccovarchives
|
77
|
+
# Exports .xccovreports and collects the paths
|
78
|
+
unless xcresults_to_parse_and_export.empty?
|
79
|
+
xccoverage_files = process_xcresults!(xcresults_to_parse_and_export)
|
60
80
|
end
|
61
81
|
|
82
|
+
# Errors if no coverage files were found
|
83
|
+
if xccoverage_files.empty?
|
84
|
+
ErrorHandler.handle_error("XccoverageFileNotFound")
|
85
|
+
end
|
62
86
|
|
63
87
|
# Convert .xccoverage file to json
|
64
88
|
ide_foundation_path = Xcov.config[:legacy_support] ? nil : Xcov.config[:ideFoundationPath]
|
@@ -172,21 +196,36 @@ module Xcov
|
|
172
196
|
end
|
173
197
|
|
174
198
|
path = Xcov.config[:xccov_file_direct_path]
|
175
|
-
if File.extname(path) == '.xcresult'
|
176
|
-
return export_paths_from_xcresult!(path)
|
177
|
-
end
|
178
|
-
|
179
199
|
return [Pathname.new(path).to_s]
|
180
200
|
end
|
181
201
|
|
182
|
-
def
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
202
|
+
def process_xcresults!(xcresult_paths)
|
203
|
+
output_path = Xcov.config[:output_directory]
|
204
|
+
FileUtils.mkdir_p(output_path)
|
205
|
+
|
206
|
+
return xcresult_paths.flat_map do |xcresult_path|
|
207
|
+
begin
|
208
|
+
parser = XCResult::Parser.new(path: xcresult_path)
|
209
|
+
|
210
|
+
# Exporting to same directory as xcresult
|
211
|
+
archive_paths = parser.export_xccovarchives(destination: output_path)
|
212
|
+
report_paths = parser.export_xccovreports(destination: output_path)
|
213
|
+
|
214
|
+
# Informating user of export paths
|
215
|
+
archive_paths.each do |path|
|
216
|
+
UI.important("Copying .xccovarchive to #{path}")
|
217
|
+
end
|
218
|
+
report_paths.each do |path|
|
219
|
+
UI.important("Copying .xccovreport to #{path}")
|
220
|
+
end
|
190
221
|
|
222
|
+
report_paths
|
223
|
+
rescue
|
224
|
+
UI.error("Error occured while exporting xccovreport from xcresult '#{xcresult_path}'")
|
225
|
+
UI.error("Make sure you have both Xcode 11 selected and pointing to the correct xcresult file")
|
226
|
+
UI.crash!("Failed to export xccovreport from xcresult'")
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
191
230
|
end
|
192
231
|
end
|
data/lib/xcov/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Vidal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0.
|
95
|
+
version: 0.2.0
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.
|
102
|
+
version: 0.2.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: bundler
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,7 +190,7 @@ files:
|
|
190
190
|
- views/function.erb
|
191
191
|
- views/report.erb
|
192
192
|
- views/target.erb
|
193
|
-
homepage: https://github.com/
|
193
|
+
homepage: https://github.com/fastlane-community/xcov
|
194
194
|
licenses:
|
195
195
|
- MIT
|
196
196
|
metadata: {}
|
@@ -209,7 +209,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
|
212
|
+
rubyforge_project:
|
213
|
+
rubygems_version: 2.7.6
|
213
214
|
signing_key:
|
214
215
|
specification_version: 4
|
215
216
|
summary: xcov is a friendly visualizer for Xcode's code coverage files
|