8000 GitHub - codecov/example-objc at future
[go: up one dir, main page]

Skip to content

codecov/example-objc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codecov Objective-C Example

codecov.io

https://codecov.io @codecov hello@codecov.io

This repository serves as an example on how to use Codecov Global for Xcode in both Objective-C and Swift.

Setup

  • Create a shared scheme for your test target https://i.imgur.com/JKNFq0G.png
  • At the highest, your deployment target can be 8.1 or earlier. This will update as Travis supports more simulators.
  • Write unit tests
  • Setup your CI

xctool also does not respect the /Scheme/TestAction/@codeCoverageEnabled setting in .xcscheme files. Make sure -enableCodeCoverage YES is set.

Travis CI

Add to your .travis.yml file.

language: objective-c
script: 
  - xctool -project {{path_to_xcodeproj}} -scheme {{your_testing_scheme}} build test -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
after_success:
  - bash <(curl -s https://codecov.io/bash)

Reference http://docs.travis-ci.com/user/languages/objective-c/

The two important parts are:

  • GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES (To have Xcode create code coverage files)
  • bash <(curl -s https://codecov.io/bash) (To upload code coverage to Codecov.io)

This is used to have Xcode output code coverage files for Codecov.io to process.

Private Repos

Set CODECOV_TOKEN in your environment variables.

Add to your .travis.yml file.

after_success:
  - bash <(curl -s https://codecov.io/bash) -t :uuid-repo-token

Or you can set the enviornment variable CODECOV_TOKEN to your token.

View source and learn more about Codecov Global Uploader

Releases

No releases published

Packages

No packages published
0