Skip to content

Commit 56014e9

Browse files
committed
[ExplicitModuleBuilds][Tests] Remove test of prior approach at handling dependency PCH
As of swiftlang/swift#69109 we no longer propagate the PCH to dependencies in non-cached builds. For cached builds, this functionality is tested in 'testCacheBuildEndToEndWithBinaryHeaderDeps'.
1 parent 1ac2578 commit 56014e9

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

-76
Original file line numberDiff line numberDiff line change
@@ -1016,82 +1016,6 @@ final class ExplicitModuleBuildTests: XCTestCase {
10161016
}
10171017
}
10181018

1019-
func testExplicitModuleBuildEndToEndWithBinaryHeaderDeps() throws {
1020-
try withTemporaryDirectory { path in
1021-
try localFileSystem.changeCurrentWorkingDirectory(to: path)
1022-
let moduleCachePath = path.appending(component: "ModuleCache")
1023-
try localFileSystem.createDirectory(moduleCachePath)
1024-
let PCHPath = path.appending(component: "PCH")
1025-
try localFileSystem.createDirectory(PCHPath)
1026-
let FooInstallPath = path.appending(component: "Foo")
1027-
try localFileSystem.createDirectory(FooInstallPath)
1028-
let foo = path.appending(component: "foo.swift")
1029-
try localFileSystem.writeFileContents(foo) {
1030-
$0.send("extension Profiler {")
1031-
$0.send(" public static let count: Int = 42")
1032-
$0.send("}")
1033-
}
1034-
let fooHeader = path.appending(component: "foo.h")
1035-
try localFileSystem.writeFileContents(fooHeader) {
1036-
$0.send("struct Profiler { void* ptr; };")
1037-
}
1038-
let main = path.appending(component: "main.swift")
1039-
try localFileSystem.writeFileContents(main) {
1040-
$0.send("import Foo")
1041-
}
1042-
let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
1043-
1044-
var fooBuildDriver = try Driver(args: ["swiftc",
1045-
"-explicit-module-build",
1046-
"-module-cache-path", moduleCachePath.nativePathString(escaped: true),
1047-
"-working-directory", path.nativePathString(escaped: true),
1048-
foo.nativePathString(escaped: true),
1049-
"-emit-module", "-wmo", "-module-name", "Foo",
1050-
"-emit-module-path", FooInstallPath.nativePathString(escaped: true),
1051-
"-import-objc-header", fooHeader.nativePathString(escaped: true),
1052-
"-pch-output-dir", PCHPath.nativePathString(escaped: true),
1053-
FooInstallPath.appending(component: "Foo.swiftmodule").nativePathString(escaped: true)]
1054-
+ sdkArgumentsForTesting,
1055-
env: ProcessEnv.vars)
1056-
1057-
// Ensure this tooling supports this functionality
1058-
let dependencyOracle = InterModuleDependencyOracle()
1059-
let scanLibPath = try XCTUnwrap(fooBuildDriver.toolchain.lookupSwiftScanLib())
1060-
guard try dependencyOracle
1061-
.verifyOrCreateScannerInstance(fileSystem: localFileSystem,
1062-
swiftScanLibPath: scanLibPath) else {
1063-
XCTFail("Dependency scanner library not found")
1064-
return
1065-
}
1066-
guard try dependencyOracle.supportsBinaryModuleHeaderDependencies() else {
1067-
throw XCTSkip("libSwiftScan does not support binary module header dependencies.")
1068-
}
1069-
1070-
let fooJobs = try fooBuildDriver.planBuild()
1071-
try fooBuildDriver.run(jobs: fooJobs)
1072-
XCTAssertFalse(fooBuildDriver.diagnosticEngine.hasErrors)
1073-
1074-
var driver = try Driver(args: ["swiftc",
1075-
"-I", FooInstallPath.nativePathString(escaped: true),
1076-
"-explicit-module-build", "-emit-module", "-emit-module-path",
1077-
path.appending(component: "testEMBETEWBHD.swiftmodule").nativePathString(escaped: true),
1078-
"-module-cache-path", moduleCachePath.nativePathString(escaped: true),
1079-
"-working-directory", path.nativePathString(escaped: true),
1080-
main.nativePathString(escaped: true)] + sdkArgumentsForTesting,
1081-
env: ProcessEnv.vars)
1082-
let jobs = try driver.planBuild()
1083-
let compileJob = try XCTUnwrap(jobs.first(where: { $0.description == "Compiling main main.swift" }))
1084-
1085-
// Ensure the header dependency of Foo shows up on client compile commands
1086-
XCTAssertTrue(compileJob.commandLine.contains(subsequence: [.flag("-Xcc"),
1087-
.flag("-include-pch"),
1088-
.flag("-Xcc"),
1089-
.path(.absolute(PCHPath.appending(component: "foo.pch")))]))
1090-
try driver.run(jobs: jobs)
1091-
XCTAssertFalse(driver.diagnosticEngine.hasErrors)
1092-
}
1093-
}
1094-
10951019
func testExplicitModuleBuildEndToEnd() throws {
10961020
try withTemporaryDirectory { path in
10971021
try localFileSystem.changeCurrentWorkingDirectory(to: path)

0 commit comments

Comments
 (0)