xcov 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -3
- data/lib/xcov/options.rb +6 -0
- data/lib/xcov/runner.rb +18 -1
- data/lib/xcov/version.rb +1 -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: 4f3c93472805e77a126f13edef348e6862457049
|
4
|
+
data.tar.gz: ba57207729613ff18a08d20af97c47e2cbbe920b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb17cd46cdd0a5eb086bebd392fe4cfba64dfac72ff13f8cd8db5d1675b38d72c58be60434f943682f5f41a0fa25d56353e53cfca37959fa0edc2e64bdb2f04
|
7
|
+
data.tar.gz: 088c9a5e60bbe3e32f969350a215df7c90b3e14c0ef316344a79d421a7cf8de063a5135a95d67f951aa7bd3c5fbcf5d043f50df1b790028a3f8627b8a55dc9ee
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
![/assets_readme/gather_coverage.png](/assets_readme/logo.png)
|
2
2
|
-------
|
3
|
-
[![Twitter: @
|
3
|
+
[![Twitter: @carlostify](https://img.shields.io/badge/contact-@carlostify-blue.svg?style=flat)](https://twitter.com/carlostify)
|
4
4
|
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/nakiostudio/xcov/blob/master/LICENSE)
|
5
5
|
[![Gem](https://img.shields.io/gem/v/xcov.svg?style=flat)](http://rubygems.org/gems/xcov)
|
6
|
+
[![Gem Downloads](https://img.shields.io/gem/dt/xcov.svg?style=flat)](http://rubygems.org/gems/xcov)
|
6
7
|
|
7
8
|
**xCov** is a friendly visualizer for Xcode's code coverage files.
|
8
9
|
|
@@ -31,7 +32,7 @@ In order to make *xCov* run you must:
|
|
31
32
|
![/assets_readme/gather_coverage.png](/assets_readme/gather_coverage.png)
|
32
33
|
|
33
34
|
## Usage
|
34
|
-
*xCov* analyzes the `.xccoverage` files created after running your tests therefore,
|
35
|
+
*xCov* analyzes the `.xccoverage` files created after running your tests therefore, before executing xCov, you need to run your tests with either `Xcode`, `xcodebuild` or [scan](https://github.com/fastlane/scan). Once completed, obtain your coverage report by providing a few parameters:
|
35
36
|
```
|
36
37
|
xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
|
37
38
|
```
|
@@ -42,6 +43,7 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
|
|
42
43
|
* `scheme` `-s`: Scheme of the project to analyze.
|
43
44
|
* `output_directory` `-o`: Path for the output folder where the report files will be saved.
|
44
45
|
* `derived_data_path` `-j`: Path of your project `Derived Data` folder (optional).
|
46
|
+
* `minimum_coverage_percentage` `-m`: Raise exception if overall coverage percentage is under this value (ie. 75)
|
45
47
|
* `slack_url` `-i`: Incoming WebHook for your Slack group to post results (optional).
|
46
48
|
* `slack_channel` `-e`: Slack channel where the results will be posted (optional).
|
47
49
|
* `skip_slack`: Add this flag to avoid publishing results on Slack (optional).
|
@@ -56,5 +58,19 @@ xcov(
|
|
56
58
|
)
|
57
59
|
```
|
58
60
|
|
59
|
-
|
61
|
+
## Changelog
|
62
|
+
|
63
|
+
### v.0.3
|
64
|
+
* Raised exception when the minimum coverage threshold is not reached (by **opfeffer**)
|
65
|
+
|
66
|
+
### v.0.2
|
67
|
+
* Fixed bug expanding/collapsing rows with same filename
|
68
|
+
* Added Fastlane integration to README
|
69
|
+
|
70
|
+
## Contributors
|
71
|
+
|
72
|
+
* [nakiostudio](https://github.com/nakiostudio)
|
73
|
+
* [opfeffer](https://github.com/opfeffer)
|
74
|
+
|
75
|
+
## License
|
60
76
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
data/lib/xcov/options.rb
CHANGED
@@ -45,6 +45,12 @@ module Xcov
|
|
45
45
|
env_name: "XCOV_OUTPUT_DIRECTORY",
|
46
46
|
description: "The directory in which all reports will be stored",
|
47
47
|
default_value: File.join(containing, "xcov_report")),
|
48
|
+
FastlaneCore::ConfigItem.new(key: :minimum_coverage_percentage,
|
49
|
+
short_option: "-m",
|
50
|
+
env_name: "XCOV_MINIMUM_COVERAGE_PERCENTAGE",
|
51
|
+
description: "Raise exception if overall coverage percentage is under this value (ie. 75)",
|
52
|
+
type: Float,
|
53
|
+
default_value: 0),
|
48
54
|
FastlaneCore::ConfigItem.new(key: :slack_url,
|
49
55
|
short_option: "-i",
|
50
56
|
env_name: "SLACK_URL",
|
data/lib/xcov/runner.rb
CHANGED
@@ -11,7 +11,8 @@ module Xcov
|
|
11
11
|
|
12
12
|
def run
|
13
13
|
report_json = parse_xccoverage
|
14
|
-
generate_xcov_report(report_json)
|
14
|
+
report = generate_xcov_report(report_json)
|
15
|
+
validate_report(report)
|
15
16
|
end
|
16
17
|
|
17
18
|
def parse_xccoverage
|
@@ -73,6 +74,22 @@ module Xcov
|
|
73
74
|
|
74
75
|
# Raise exception in case of failure
|
75
76
|
raise "Unable to create coverage report" if report.nil?
|
77
|
+
|
78
|
+
report
|
79
|
+
end
|
80
|
+
|
81
|
+
def validate_report report
|
82
|
+
exit_status = 0
|
83
|
+
|
84
|
+
# Raise exception if overall coverage
|
85
|
+
minimumPercentage = Xcov.config[:minimum_coverage_percentage] / 100
|
86
|
+
if minimumPercentage > report.coverage
|
87
|
+
exit_status = 1
|
88
|
+
|
89
|
+
UI.user_error!("Actual Code Coverage (#{"%.2f%" % (report.coverage*100)}) below threshold of #{"%.2f%" % (minimumPercentage*100)}")
|
90
|
+
end
|
91
|
+
|
92
|
+
exit_status
|
76
93
|
end
|
77
94
|
|
78
95
|
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: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Vidal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|