Xccov: Code coverage report is empty when running tests from command line with xcodebuild test-without-building

Originator:vytis.s.lt
Number:rdar://37745670 Date Originated:21-Feb-2018 05:13 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9.3 beta 3
Classification:Serious Bug Reproducible:Always
 
Summary:
When building an iOS project from command line using xcodebuild build-for-testing and then running tests with xcodebuild test-without-building the code coverage files are empty.

Steps to Reproduce:
1. Build project with:
xcodebuild -scheme Codecov -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.3' -enableCodeCoverage YES build-for-testing
2. Run tests on resulting .xctestrun bundle:
xcodebuild -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.3' -enableCodeCoverage YES -xctestrun /path/to/DerivedData/Codecov-azxfrlmhznktvjavwttdxmosuzdn/Build/Products/Codecov_iphonesimulator11.0-x86_64.xctestrun test-without-building
3. Check code coverage with xccov:
xcrun xccov view  /path/to/DerivedData/Codecov-azxfrlmhznktvjavwttdxmosuzdn/Logs/Test/9121DDEF-52B1-4BC5-9EBC-5E06E7693EF3.xccovreport

Expected Results:
4. See code coverage information

Actual Results:
4. Results are empty:

Name Coverage
---- --------

Version:
Xcode 9.3 beta 3

Notes:
When running xccov with results generated from running tests from Xcode the output is what is expected:

Attaching the code of the project and contents of DerivedData after running test in step #2

A version of the same issue was filed before introduction of xccov -  rdar://36907005

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!