Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
rdar://109060298
  • Loading branch information
rintaro committed May 8, 2023
1 parent bf2de71 commit c75cfd4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6776,6 +6776,7 @@ final class SwiftDriverTests: XCTestCase {

try withTemporaryDirectory { tmpDir in
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift"],
integratedDriver: false,
compilerExecutableDir: tmpDir)
guard driver.isFrontendArgSupported(.externalPluginPath) else {
return
Expand Down Expand Up @@ -6818,6 +6819,27 @@ final class SwiftDriverTests: XCTestCase {
}
}

func testExternalPluginPathsDisabled() throws {
#if !os(macOS)
throw XCTSkip("Supported only in macOS")
#endif

try withTemporaryDirectory { tmpDir in
var driver = try Driver(args: ["swiftc", "-typecheck", "foo.swift"],
integratedDriver: true,
compilerExecutableDir: tmpDir)
guard driver.isFrontendArgSupported(.externalPluginPath) else {
return
}

let jobs = try driver.planBuild().removingAutolinkExtractJobs()
XCTAssertEqual(jobs.count, 1)
let job = jobs.first!

XCTAssertFalse(job.commandLine.contains(.flag("-external-plugin-path")))
}
}

func testClangModuleValidateOnce() throws {
let flagTest = try Driver(args: ["swiftc", "-typecheck", "foo.swift"])
guard flagTest.isFrontendArgSupported(.clangBuildSessionFile),
Expand Down

0 comments on commit c75cfd4

Please sign in to comment.