Test Coverage is not shown for all targets in the project

Thanks.

I"m assuming your using the built-in Swift analyzer (made by SonarSource and bundled with the Developer Edition) rather than Idean/sonar-swift

Which, if true, means that these settings are having zero effect. Just a side note not really relevant here, but maybe it spruces up your project files. :slight_smile:

sonar.swift.project=Project.xcodeproj
sonar.swift.workspace=Project.xcworkspace
sonar.swift.simulator=platform=iOS Simulator,name=iPhone 12,OS=14.5

#Scheme to build your application
sonar.swift.appScheme=Project

To import coverage on Swift projects, you have two options as noted in the. documentation on Test Coverage & Execution

Language Property Remarks
Swift, Xcode 9.3+ You can use the xccov-to-sonarqube-generic.sh script from the sonar-scanning-examples/swift-coverage project convert output from Xcode 9.3’s xccov tool to the Generic Test Data format.
Swift, Xcode 7-9.2 sonar.swift.coverage.reportPath Path to the report generated by llvm-cov show . Path may be absolute or relative to project root.

You will need to make sure you have coverage reports being produced for all of your code and passed to the correct analysis parameter for coverage to be displayed.

There’s also a community guide available here: