Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

KazuCocoa/xccov-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xccov::Parse

Installation

Add this line to your application's Gemfile:

gem 'xccov-parse'

And then execute:

$ bundle

Or install it yourself as:

$ gem install xccov-parse

Usage

  1. Generate the json result by xcrun xccov view --only-targets --json
    # target: https://github.com/KazuCocoa/test.examples
    $ git clone https://github.com/KazuCocoa/test.examples && cd test.examples
    $ xcodebuild -workspace test.examples.xcworkspace -scheme test.examples -derivedDataPath Build/ -destination 'platform=iOS Simulator,OS=11.3,name=iPhone 7' -enableCodeCoverage YES clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
  2. Read the JSON and get a particular line coverage
    xccov = Xccov.new
    xccov.help
    json = xccov.view '--only-targets', '--json', 'Build/Logs/Test/*.xccovreport'
    parsed = Xccov::Parse.new(json: json)
    parsed.targets_line_coverage["test.examples.app"] #=> 0.35
    
    # or
    # $ xcrun xccov view --only-targets --json Build/Logs/Test/*.xccovreport > result.json
    parsed = Xccov::Parse.new(file: './result.json')
    parsed.targets_line_coverage["test.examples.app"] #=> 0.35

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/KazuCocoa/xccov-parse.

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published