Skip to content

Commit a15f3a9

Browse files
committed
Add SwiftBuild coverage support
Ensure the SwiftBuild build systam has feature parity with the Native build system as it relates to coverage. Fixes: #9077 Issue: rdar://159461439
1 parent 96d689a commit a15f3a9

File tree

5 files changed

+695
-492
lines changed

5 files changed

+695
-492
lines changed

Sources/Commands/SwiftTestCommand.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ public struct SwiftTestCommand: AsyncSwiftCommand {
619619
}
620620
}
621621
args += ["-o", productsBuildParameters.codeCovDataFile.pathString]
622-
623622
try await AsyncProcess.checkNonZeroExit(arguments: args)
624623
}
625624

Sources/SwiftBuildSupport/SwiftBuildSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
923923

924924
private static func constructTestingSettingsOverrides(from parameters: BuildParameters.Testing) -> [String: String] {
925925
var settings: [String: String] = [:]
926-
// TODO: enableCodeCoverage
927-
// explicitlyEnabledTestability
926+
927+
settings["CLANG_COVERAGE_MAPPING"] = parameters.enableCodeCoverage ? "YES" : "NO"
928928

929929
switch parameters.explicitlyEnabledTestability {
930930
case true:

0 commit comments

Comments
 (0)