UITestCoverageBug
Coverage report for tests run via xcodebuild CLI do not include the coverage from UI tests. Tests run from XCode IDE however do include the coverage from UI Tests
Install / Use
/learn @iwllyu/UITestCoverageBugREADME
Looks like this bug is fixed in XCode9. Thanks coryalder
Test case for missing UI Test Coverage. The problem/potential solution is detailed here by thelvis4.
Still bugged in:
- XCode 7.3.1
- XCode 8.1 with Swift 3 (thanks raven)
- Xcode 8.2 with Swift 3
- Xcode 8.3.2 (michaellady)
Coverage report for tests run via xcodebuild CLI do not include the coverage from UI tests. Tests run from XCode IDE however do include the coverage from UI Tests
Running the the tests from XCode IDE (This is the Expected Behavior)
- Run from XCode IDE (Product -> Test, or Command+U)
- Generate code coverage. Replace with path to your
Coverage.profdata
- xcrun llvm-cov report -instr-profile /Users/wyu/Library/Developer/Xcode/DerivedData/UITestCoverageBug-gmabjwcdjgubltcmkzrskeqbhvcw/Build/Intermediates/CodeCoverage/Coverage.profdata /Users/wyu/Library/Developer/Xcode/DerivedData/UITestCoverageBug-gmabjwcdjgubltcmkzrskeqbhvcw/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/UITestCoverageBug.app/UITestCoverageBug
|Filename |Regions| Miss| Cover| Functions| Executed| |--------------------------------------------------------------------------------------------|-------|--------|--------|----------|----------| |/Users/wyu/sandbox/iwllyu-github/UITestCoverageBug/UITestCoverageBug/AppDelegate.swift | 6 | 4 | 33.33% | 6 | 33.33% | |/Users/wyu/sandbox/iwllyu-github/UITestCoverageBug/UITestCoverageBug/ViewController.swift | 5 | 1 | 80.00% | 5 | 80.00% | |TOTAL | 11 | 5 | 54.55% | 11 | 54.55% | 11 5 54.55% 11 54.55%
Running the tests from xcodebuild CLI (Bugged Behavior, Coverage.profdata does not include coverage for UI Tests)
- Build the project
xcodebuild clean test -scheme UITestCoverageBug \
-project UITestCoverageBug.xcodeproj \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3' \
-enableCodeCoverage YES
- Generate code coverage. Replace with path to your
Coverage.profdata
- xcrun llvm-cov report -instr-profile /Users/wyu/Library/Developer/Xcode/DerivedData/UITestCoverageBug-gmabjwcdjgubltcmkzrskeqbhvcw/Build/Intermediates/CodeCoverage/Coverage.profdata /Users/wyu/Library/Developer/Xcode/DerivedData/UITestCoverageBug-gmabjwcdjgubltcmkzrskeqbhvcw/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/UITestCoverageBug.app/UITestCoverageBug
|Filename |Regions| Miss| Cover| Functions| Executed| |--------------------------------------------------------------------------------------------|-------|--------|--------|----------|----------| |/Users/wyu/sandbox/iwllyu-github/UITestCoverageBug/UITestCoverageBug/AppDelegate.swift | 6 | 4 | 33.33% | 6 | 33.33% | |/Users/wyu/sandbox/iwllyu-github/UITestCoverageBug/UITestCoverageBug/ViewController.swift | 5 | 3 | 40.00% | 5 | 40.00% | |TOTAL | 11 | 7 | 36.36% | 11 | 36.36% |
Related Skills
node-connect
341.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
