Issue:
The input variable Generate code coverage files? is set to yes
but I can't find the files.
Possible solutions:
The flags that are being used with the current input variable Generate code coverage files? are outdated. We have a ticket open to address this issue and update the Step.
In the meantime, you can use the following to generate these files:
Do not use
generate_code_coverage_files
. Make sure the value for this input isno
.Use
xcodebuild_test_options
to turn on coverage report generation by specifying:-enableCodeCoverage YES
Add a Script Step which can be used to view the coverage report:
- script: inputs: - content: |- #!/bin/env bash set -ex # line coverage percentages for each target, source file, and function/method that has coverage information xcrun xccov view --report $BITRISE_XCRESULT_PATH # get the list of files from result bundle xcrun xccov view --archive --file-list $BITRISE_XCRESULT_PATH # get line coverage for a given file xcrun xccov view --archive --file "$BITRISE_SOURCE_DIR/_tmp/ios-simple-objc/ios-simple-objc/ViewController.m" $BITRISE_XCRESULT_PATH
The script contains 3 different calls to xcrun xccov view
calls:
The first call prints the coverage percentage for all targets.
The second call prints all the available files.
The third call prints coverage for a given file.