test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

Feature Request: support `xccov` JSON format

Open eelco opened this issue 7 years ago • 3 comments

For a while now (since Xcode 9.3) Apple ships a tool for code coverage. (Run it with xcrun xccov).

It can read the coverage files generated by Xcode and translate them into JSON.

It would be great if the test reporter could support those JSON files, as it would save a bunch of dependencies for getting Objective-C / Swift coverage into Code Climate.

eelco avatar Nov 22 '18 09:11 eelco

Good idea! Our team probably won't be able to incorporate this into our own planning in the near-term, so I've added the "help wanted" label here. This would be great to see as a PR if anyone has time.

wfleming avatar Nov 26 '18 15:11 wfleming

Sorry for the digging this issue out of the grave but has this perhaps been addressed on #399 ? And could anyone point me to the doc on how to use it?

andresilveirah avatar Jun 25 '20 14:06 andresilveirah

I also cannot find the document but it worked as I expected.

$ xcodebuild test -resultBundlePath result_bundle.xcresult
$ xcrun xccov view --report --json result_bundle.xcresult > coverage.json
$ cc-test-reporter format-coverage -t xccov coverage.json

manicmaniac avatar Nov 17 '22 16:11 manicmaniac