Skip to content

Commit c75cfd4

Browse files
committed
Add test case
rdar://109060298
1 parent bf2de71 commit c75cfd4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6776,6 +6776,7 @@ final class SwiftDriverTests: XCTestCase {
67766776

67776777
try withTemporaryDirectory { tmpDir in
67786778
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift"],
6779+
integratedDriver: false,
67796780
compilerExecutableDir: tmpDir)
67806781
guard driver.isFrontendArgSupported(.externalPluginPath) else {
67816782
return
@@ -6818,6 +6819,27 @@ final class SwiftDriverTests: XCTestCase {
68186819
}
68196820
}
68206821

6822+
func testExternalPluginPathsDisabled() throws {
6823+
#if !os(macOS)
6824+
throw XCTSkip("Supported only in macOS")
6825+
#endif
6826+
6827+
try withTemporaryDirectory { tmpDir in
6828+
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift"],
6829+
integratedDriver: true,
6830+
compilerExecutableDir: tmpDir)
6831+
guard driver.isFrontendArgSupported(.externalPluginPath) else {
6832+
return
6833+
}
6834+
6835+
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
6836+
XCTAssertEqual(jobs.count, 1)
6837+
let job = jobs.first!
6838+
6839+
XCTAssertFalse(job.commandLine.contains(.flag("-external-plugin-path")))
6840+
}
6841+
}
6842+
68216843
func testClangModuleValidateOnce() throws {
68226844
let flagTest = try Driver(args: ["swiftc", "-typecheck", "foo.swift"])
68236845
guard flagTest.isFrontendArgSupported(.clangBuildSessionFile),

0 commit comments

Comments
 (0)