Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1495,8 +1495,11 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
let matchingBuildSetting = feature.buildSettings?.first(where: {
if let macro = try? cbc.scope.namespace.declareBooleanMacro($0) {
return cbc.scope.evaluate(macro)
} else if let macro = try? cbc.scope.namespace.declareStringMacro($0) {
return cbc.scope.evaluate(macro) == "YES"
} else {
return false
}
return false
})
if matchingBuildSetting != nil {
continue
Expand Down
39 changes: 39 additions & 0 deletions Tests/SWBBuildSystemTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4944,6 +4944,45 @@ fileprivate struct SwiftDriverTests: CoreBasedTests {
}
}

//Reinit the core to invalidate all caching
tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false)
// Test with a setting which has a MIGRATE mode
do {
try await tester.fs.writeFileContents(blockListFilePath) { file in
file <<<
"""
{
"features": {
"MemberImportVisibility": {
"level": "warn",
"buildSettings": ["SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY"],
"learnMoreURL": "https://www.swift.org/swift-evolution/",
"moduleExceptions": []
}
}
}
"""
}

do {
let params = BuildParameters(configuration: "Debug")
try await tester.checkBuild(runDestination: .macOS, buildRequest: parameterizedBuildRequest(params)) { results in
results.checkWarning(.contains("Enabling the Swift language feature 'MemberImportVisibility' will become a requirement in the future; set 'SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES'"))
results.checkNoDiagnostics()
}
try await tester.checkBuild(runDestination: .macOS, buildRequest: cleanRequest) { results in results.checkNoErrors() }
}

do {
let params = BuildParameters(configuration: "Debug",
commandLineOverrides: ["SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY": "YES"])
try await tester.checkBuild(runDestination: .macOS, buildRequest: parameterizedBuildRequest(params)) { results in
results.checkNoDiagnostics()
}
try await tester.checkBuild(runDestination: .macOS, buildRequest: cleanRequest) { results in results.checkNoErrors() }
}
}

// Test with module exceptions specified in the block list.
//Reinit the core to invalidate all caching
tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false)
Expand Down