Contents

elegantchaos/coverage

A tool which uses xcrun and xccov to extract a summary of the code coverage results from an Xcode coverage report.

Build

Build using SPM:

swift build

Run from the build directory

.build/debug/coverage --help

Install by simply copying .build/debug/coverage elsewhere.

Continuous Integration

You can use this tool in continuous integration runs, to check that your coverage remains above a certain threshold.

For example, to test whether the coverage project itself has a coverage of over 80%, you might do:

xcodebuild test -workspace Coverage.xcworkspace -scheme Coverage -enableCodeCoverage YES -resultBundlePath Test.xcresult
coverage Test.xcresult Coverage --threshold=0.8

If the coverage drops below the threshold, the coverage command will exit with a non-zero value, which should cause the CI job to fail.

Package Metadata

Repository: elegantchaos/coverage

Default branch: master

README: README.md