Skip to content
Permalink
Browse files

Measure code coverage

  • Loading branch information...
kishikawakatsumi committed Feb 6, 2018
1 parent 85a55b7 commit 55df8c3a0e9b3b22bb8bb5de055b9eb20b9cc83f
Showing with 12 additions and 1 deletion.
  1. +2 −1 .travis.yml
  2. +10 −0 scripts/coverage.rb
@@ -5,7 +5,8 @@ script:
-sdk "$SDK" -destination "$DESTINATION" -derivedDataPath build
-enableCodeCoverage YES ENABLE_TESTABILITY=YES "$ACTION"
after_success:
- bash <(curl -s https://codecov.io/bash)
- ruby scripts/coverage.rb "$SCHEME"
- bash <(curl -s https://codecov.io/bash) -f 'coverage.txt'
env:
matrix:
- SDK=iphonesimulator CONFIGURATION=Debug ACTION=test
@@ -0,0 +1,10 @@
project_name = ARGV[0]
profdata = Dir.glob(File.join('build', '/**/Coverage.profdata')).first
Dir.glob(File.join('build', "/**/#{project_name}")) do |target|
output = `xcrun llvm-cov report -instr-profile "#{profdata}" "#{target}" -arch=x86_64`
if $?.success?
puts output
`xcrun llvm-cov show -instr-profile "#{profdata}" "#{target}" -arch=x86_64 -use-color=0 > coverage.txt`
break
end
end

0 comments on commit 55df8c3

Please sign in to comment.
You can’t perform that action at this time.