Code coverage is always of 0% with command line tools

Originator:yannick.loriot
Number:rdar://28317671 Date Originated:15/09/2016
Status:Closed Resolved:
Product:Developer Tools Product Version:
Classification:Other Bug Reproducible:
 
Summary:
During test phase I gather code coverage files to export them to the Codecov tool in order to track the quality of my code.

However with Xcode 8 the coverage reports are always to 0%. Everything works inside Xcode 8 but using xcodebuild the coverage files only indicates empty lines. For example:

```
      0|   45|  public convenience init(L: CGFloat, a: CGFloat, b: CGFloat) {
      0|   46|    let clippedL = clip(L, 0, 100)
      0|   47|    let clippedA = clip(a, -128, 127)
      0|   48|    let clippedB = clip(b, -128, 127)
```

For more information this github issue: https://github.com/codecov/example-swift/issues/14

Steps to Reproduce:
1. Running tests with xcodebuild on a Swift 3 and Xcode 8 project with code coverage available (like https://github.com/yannickl/DynamicColor/Examples/DynamicColorExample.xcodeproj)

Expected Results:
The *.coverage.txt with the correct occurrence lines.

Actual Results:
The *.coverage.txt gives me only missed lines.

Version:
Version 8.0 (8A218a), OSX 10.11.6 (15G1004)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!