xcov 0.3 → 0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f3c93472805e77a126f13edef348e6862457049
4
- data.tar.gz: ba57207729613ff18a08d20af97c47e2cbbe920b
3
+ metadata.gz: 61d71177e02e5309208870af2792be985ee85401
4
+ data.tar.gz: 278e621bda56cfade3452f8704b84fbfe0e9ab2c
5
5
  SHA512:
6
- metadata.gz: beb17cd46cdd0a5eb086bebd392fe4cfba64dfac72ff13f8cd8db5d1675b38d72c58be60434f943682f5f41a0fa25d56353e53cfca37959fa0edc2e64bdb2f04
7
- data.tar.gz: 088c9a5e60bbe3e32f969350a215df7c90b3e14c0ef316344a79d421a7cf8de063a5135a95d67f951aa7bd3c5fbcf5d043f50df1b790028a3f8627b8a55dc9ee
6
+ metadata.gz: 472c701c1c429a60bb9a3bb57a8f19cc68f671d789fb629a18b4367cf24c7da3d9261505aeab5d91db029fa64989a45e4df7f32d5b043b0d77138594376d8fa5
7
+ data.tar.gz: a6895a791a25380b32cac92820920aed33297177d24199b9a0e39c9c6838e9b9f7fd3676f57054ce2367d7e8e8560ea526c6c6eaea68f1b269d528f55211d7d7
data/README.md CHANGED
@@ -38,15 +38,16 @@ xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output
38
38
  ```
39
39
 
40
40
  ### Parameters allowed
41
- * `workspace` `-w`: Path of your `xcworkspace` file.
42
- * `project` `-p`: Path of your `xcodeproj` file (optional).
43
- * `scheme` `-s`: Scheme of the project to analyze.
44
- * `output_directory` `-o`: Path for the output folder where the report files will be saved.
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)
47
- * `slack_url` `-i`: Incoming WebHook for your Slack group to post results (optional).
48
- * `slack_channel` `-e`: Slack channel where the results will be posted (optional).
49
- * `skip_slack`: Add this flag to avoid publishing results on Slack (optional).
41
+ * `--workspace` `-w`: Path of your `xcworkspace` file.
42
+ * `--project` `-p`: Path of your `xcodeproj` file (optional).
43
+ * `--scheme` `-s`: Scheme of the project to analyze.
44
+ * `--output_directory` `-o`: Path for the output folder where the report files will be saved.
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)
47
+ * `--include_test_targets`: Enables coverage reports for `.xctest` targets
48
+ * `--slack_url` `-i`: Incoming WebHook for your Slack group to post results (optional).
49
+ * `--slack_channel` `-e`: Slack channel where the results will be posted (optional).
50
+ * `--skip_slack`: Add this flag to avoid publishing results on Slack (optional).
50
51
 
51
52
  ### [Fastlane](https://github.com/fastlane/fastlane/blob/master/docs/Actions.md)
52
53
  *Fastlane 1.61.0* includes *xCov* as a custom action. You can easily create your coverage reports as follows:
@@ -60,6 +61,9 @@ xcov(
60
61
 
61
62
  ## Changelog
62
63
 
64
+ ### v.0.4
65
+ * Additional flag to enable coverage reports for `.xctest` targets
66
+
63
67
  ### v.0.3
64
68
  * Raised exception when the minimum coverage threshold is not reached (by **opfeffer**)
65
69
 
@@ -16,6 +16,8 @@ module Xcov
16
16
  end
17
17
 
18
18
  def average_coverage targets
19
+ return 0 if targets.count == 0
20
+
19
21
  coverage = 0
20
22
  targets.each do |target|
21
23
  coverage = coverage + target.coverage
@@ -42,9 +44,13 @@ module Xcov
42
44
  # Class methods
43
45
 
44
46
  def self.map dictionary
45
- targets = dictionary["targets"]
46
- .select { |target| !target["name"].include?(".xctest") }
47
- .map { |target| Target.map(target)}
47
+ targets = dictionary["targets"].select { |target| !target["name"].include?(".xctest") }
48
+
49
+ # Don't filter test targets if the flag is set
50
+ targets = dictionary["targets"] if Xcov.config[:include_test_targets]
51
+
52
+ # Create target objects
53
+ targets = targets.map { |target| Target.map(target)}
48
54
 
49
55
  Report.new(targets)
50
56
  end
@@ -51,6 +51,11 @@ module Xcov
51
51
  description: "Raise exception if overall coverage percentage is under this value (ie. 75)",
52
52
  type: Float,
53
53
  default_value: 0),
54
+ FastlaneCore::ConfigItem.new(key: :include_test_targets,
55
+ env_name: "XCOV_INCLUDE_TEST_TARGETS",
56
+ description: "Enables coverage reports for .xctest targets",
57
+ is_string: false,
58
+ default_value: false),
54
59
  FastlaneCore::ConfigItem.new(key: :slack_url,
55
60
  short_option: "-i",
56
61
  env_name: "SLACK_URL",
@@ -1,6 +1,6 @@
1
1
  module Xcov
2
2
 
3
- VERSION = "0.3"
3
+ VERSION = "0.4"
4
4
  DESCRIPTION = "xCov is a friendly visualizer for Xcode's code coverage files"
5
5
 
6
6
  end
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.3'
4
+ version: '0.4'
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-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core