xcov 1.5.0 → 1.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/README.md +4 -0
- data/lib/xcov/manager.rb +20 -8
- data/lib/xcov/options.rb +12 -0
- data/lib/xcov/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39093eb1a121b8746609124b8d4e7e8433127777
|
4
|
+
data.tar.gz: 521073d98ad4229dbbe7c2ded44235a4a236d9cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82f23e8a4ad93740091e26c1b5ee6defc71ecf2bd1c3ca25f2c9b2aeef87c467322a613de3c090aea80627c450a5e1f9f985e2d8a81183aba9a8d0c64b6a616
|
7
|
+
data.tar.gz: 4ab27e291ef1f3a6bea483911324d033624d143cc55f8c9925da8301cb7ccdeada8e6644e8b642f01eef74ba18818cde5df4b4d7c049876c5c7a18ff2e189e8d
|
data/README.md
CHANGED
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
**xcov** is a friendly visualizer for Xcode's code coverage files.
|
13
13
|
|
14
|
+
> Maintainers needed
|
15
|
+
|
14
16
|
## Installation
|
15
17
|
```
|
16
18
|
sudo gem install xcov
|
@@ -58,6 +60,7 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
|
|
58
60
|
* `--output_directory` `-o`: Path for the output folder where the report files will be saved.
|
59
61
|
* `--source_directory` `-r`: The path to project's root directory (optional).
|
60
62
|
* `--derived_data_path` `-j`: Path of your project `Derived Data` folder (optional).
|
63
|
+
* `--xccov_file_direct_path` `-f`: Direct path to the xccoverage/xccovreport file to parse to generate code coverage (optional).
|
61
64
|
* `--minimum_coverage_percentage` `-m`: Raise exception if overall coverage percentage is under this value (ie. 75.0).
|
62
65
|
* `--include_test_targets`: Enables coverage reports for `.xctest` targets.
|
63
66
|
* `--ignore_file_path` `-x`: Relative or absolute path to the file containing the list of ignored files.
|
@@ -152,6 +155,7 @@ If you want to keep track of the coverage evolution and get some extra features,
|
|
152
155
|
[](https://github.com/chrisballinger)
|
153
156
|
[](https://github.com/ngs)
|
154
157
|
[](https://github.com/aaroncrespo)
|
158
|
+
[](https://github.com/cmarchal)
|
155
159
|
|
156
160
|
|
157
161
|
## License
|
data/lib/xcov/manager.rb
CHANGED
@@ -37,12 +37,17 @@ module Xcov
|
|
37
37
|
|
38
38
|
def parse_xccoverage
|
39
39
|
# Find .xccoverage file
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# If no xccov direct path, use the old derived data path method
|
41
|
+
if xccov_file_direct_path.nil?
|
42
|
+
extension = Xcov.config[:legacy_support] ? "xccoverage" : "xccovreport"
|
43
|
+
test_logs_path = derived_data_path + "Logs/Test/"
|
44
|
+
xccoverage_files = Dir["#{test_logs_path}*.#{extension}", "#{test_logs_path}*.xcresult/*/action.#{extension}"].sort_by { |filename| File.mtime(filename) }.reverse
|
45
|
+
|
46
|
+
unless test_logs_path.directory? && !xccoverage_files.empty?
|
47
|
+
ErrorHandler.handle_error("XccoverageFileNotFound")
|
48
|
+
end
|
49
|
+
else
|
50
|
+
xccoverage_files = ["#{xccov_file_direct_path}"]
|
46
51
|
end
|
47
52
|
|
48
53
|
# Convert .xccoverage file to json
|
@@ -126,7 +131,7 @@ module Xcov
|
|
126
131
|
# Raise exception if overall coverage is under threshold
|
127
132
|
minimumPercentage = Xcov.config[:minimum_coverage_percentage] / 100
|
128
133
|
if minimumPercentage > report.coverage
|
129
|
-
error_message = "Actual Code Coverage (#{"%.2f
|
134
|
+
error_message = "Actual Code Coverage (#{"%.2f%%" % (report.coverage*100)}) below threshold of #{"%.2f%%" % (minimumPercentage*100)}"
|
130
135
|
ErrorHandler.handle_error_with_custom_message("CoverageUnderThreshold", error_message)
|
131
136
|
end
|
132
137
|
end
|
@@ -141,7 +146,6 @@ module Xcov
|
|
141
146
|
end
|
142
147
|
|
143
148
|
# Auxiliar methods
|
144
|
-
|
145
149
|
def derived_data_path
|
146
150
|
# If DerivedData path was supplied, return
|
147
151
|
return Pathname.new(Xcov.config[:derived_data_path]) unless Xcov.config[:derived_data_path].nil?
|
@@ -151,5 +155,13 @@ module Xcov
|
|
151
155
|
return product_builds_path.parent.parent
|
152
156
|
end
|
153
157
|
|
158
|
+
def xccov_file_direct_path
|
159
|
+
# If xccov_file_direct_path was supplied, return
|
160
|
+
if Xcov.config[:xccov_file_direct_path].nil?
|
161
|
+
return nil
|
162
|
+
end
|
163
|
+
return Pathname.new(Xcov.config[:xccov_file_direct_path])
|
164
|
+
end
|
165
|
+
|
154
166
|
end
|
155
167
|
end
|
data/lib/xcov/options.rb
CHANGED
@@ -73,6 +73,18 @@ module Xcov
|
|
73
73
|
raise "Invalid derived data path, it must point to a directory".red unless File.directory?(v)
|
74
74
|
end
|
75
75
|
),
|
76
|
+
FastlaneCore::ConfigItem.new(
|
77
|
+
key: :xccov_file_direct_path,
|
78
|
+
short_option: "-f",
|
79
|
+
env_name: "XCOV_FILE_DIRECT_PATH",
|
80
|
+
description: "The path to the xccoverage/xccovreport file to parse to generate code coverage",
|
81
|
+
optional: true,
|
82
|
+
verify_block: proc do |value|
|
83
|
+
v = File.expand_path(value.to_s)
|
84
|
+
raise "xccoverage/xccovreport file does not exist".red unless File.exist?(v)
|
85
|
+
raise "Invalid xccov file type (must be xccoverage or xccovreport)".red unless value.end_with? "xccoverage" or value.end_with? "xccovreport"
|
86
|
+
end
|
87
|
+
),
|
76
88
|
FastlaneCore::ConfigItem.new(
|
77
89
|
key: :output_directory,
|
78
90
|
short_option: "-o",
|
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.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Vidal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.5.
|
199
|
+
rubygems_version: 2.5.1
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: xcov is a friendly visualizer for Xcode's code coverage files
|