Skip to content

Commit 688a840

Browse files
artemcmtshortli
andcommitted
Update Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Co-authored-by: Allan Shortlidge <[email protected]>
1 parent ed67c4b commit 688a840

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public extension Driver {
121121
}
122122

123123
try commandLine.appendLast(.clangIncludeTree, from: &parsedOptions)
124-
try commandLine.appendLast(.clangScannerModuleCachePath, from: &parsedOptions)
124+
if isFrontendArgSupported(.clangScannerModuleCachePath) {
125+
try commandLine.appendLast(.clangScannerModuleCachePath, from: &parsedOptions)
126+
}
125127

126128
// Pass on the input files
127129
commandLine.append(contentsOf: inputFiles.filter { $0.type == .swift }.map { .path($0.file) })

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
13651365
}
13661366
}
13671367

1368-
/// Test that the scanner invocation does not rely in response files
1368+
/// Test that the scanner invocation does not rely on response files
13691369
func testDependencyScanningSeparateClangScanCache() throws {
13701370
try withTemporaryDirectory { path in
13711371
let scannerCachePath: AbsolutePath = path.appending(component: "ClangScannerCache")
@@ -1381,6 +1381,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
13811381
"-working-directory", path.nativePathString(escaped: true),
13821382
main.nativePathString(escaped: true)] + sdkArgumentsForTesting,
13831383
env: ProcessEnv.vars)
1384+
guard driver.isFrontendArgSupported(.clangScannerModuleCachePath) else {
1385+
throw XCTSkip("Skipping: compiler does not support '-clang-scanner-module-cache-path'")
1386+
}
1387+
13841388
let scannerJob = try driver.dependencyScanningJob()
13851389
XCTAssertTrue(scannerJob.commandLine.contains(subsequence: [.flag("-clang-scanner-module-cache-path"),
13861390
.path(.absolute(scannerCachePath))]))

0 commit comments

Comments
 (0)