Skip to content

Commit

Permalink
Fix generating docs
Browse files Browse the repository at this point in the history
The coverage report format has changed in Xcode 9.4. Since Xcode comes
with it's own `xccov` tool, we don't need to use `xcov-core` anymore and
extract the coverage directly by the JSON produced by the `xccov` tool.
  • Loading branch information
blochberger committed Aug 10, 2018
1 parent 2f21d20 commit 629c4d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ if [ ${RUN_TESTS} = true ]; then
clean\
test

xcov-core\
--source build/Logs/Test/*.xccoverage\
--output build/coverage.json
xcrun xccov view --json build/Logs/Test/*.xccovreport > build/coverage.json

COVERAGE=$(
python3 "extract_coverage.py" "${MODULE}.framework" < build/coverage.json
Expand Down
2 changes: 1 addition & 1 deletion extract_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
j = json.load(sys.stdin)
for i in range(len(j["targets"])):
if j["targets"][i]["name"] == framework:
print("{0:.0f}".format(j["targets"][i]["coverage"] * 100))
print("{0:.0f}".format(j["targets"][i]["lineCoverage"] * 100))
exit(0)

exit(1)

0 comments on commit 629c4d8

Please sign in to comment.