Skip to content

Instantly share code, notes, and snippets.

@T-Pham
Created April 7, 2017 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save T-Pham/3d595db25271a0fbaa8e5e4076158ac7 to your computer and use it in GitHub Desktop.
Save T-Pham/3d595db25271a0fbaa8e5e4076158ac7 to your computer and use it in GitHub Desktop.
Export test coverage from slather to shield.io badge html object
slather coverage \
--cobertura-xml \
--scheme "SchemeName" \
--workspace path/to/workspace \
XcodeProjectName.xcodeproj
xmlstarlet sel \
--template \
--match "//coverage[1]" \
--elem "object" \
--attr "width" --output "120px" --break \
--attr "height" --output "20px" --break \
--attr "data" --output "https://img.shields.io/badge/test--coverage-" --value-of "round(@line-rate * 100)" --output "%-green.svg?style=flat-square" \
cobertura.xml > test-coverage.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment