Skip to content

Commit 590f1d0

Browse files
authored
Merge pull request #1222 from artemcm/ExplicitTestsWithModuleCache
[NFC] Add `-module-cache` argument to Explicit Module Build tests
2 parents 6146666 + 1e8652c commit 590f1d0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
687687
func testModuleAliasingWithExplicitBuild() throws {
688688
try withTemporaryDirectory { path in
689689
try localFileSystem.changeCurrentWorkingDirectory(to: path)
690+
let moduleCachePath = path.appending(component: "ModuleCache")
691+
try localFileSystem.createDirectory(moduleCachePath)
690692
let srcBar = path.appending(component: "bar.swift")
691693
let moduleBarPath = path.appending(component: "Bar.swiftmodule").nativePathString(escaped: true)
692694
try localFileSystem.writeFileContents(srcBar) {
@@ -704,6 +706,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
704706
path.nativePathString(escaped: true),
705707
"-emit-module",
706708
"-emit-module-path", moduleBarPath,
709+
"-module-cache-path", moduleCachePath.nativePathString(escaped: true),
707710
srcBar.nativePathString(escaped: true),
708711
"-I", stdLibPath.nativePathString(escaped: true),
709712
"-I", shimsPath.nativePathString(escaped: true),
@@ -737,8 +740,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
737740
"-working-directory",
738741
path.nativePathString(escaped: true),
739742
"-emit-module",
740-
"-emit-module-path",
741-
moduleFooPath,
743+
"-emit-module-path", moduleFooPath,
744+
"-module-cache-path", moduleCachePath.nativePathString(escaped: true),
742745
"-module-alias",
743746
"Car=Bar",
744747
srcFoo.nativePathString(escaped: true),
@@ -756,6 +759,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
756759
func testExplicitModuleBuildEndToEnd() throws {
757760
try withTemporaryDirectory { path in
758761
try localFileSystem.changeCurrentWorkingDirectory(to: path)
762+
let moduleCachePath = path.appending(component: "ModuleCache")
763+
try localFileSystem.createDirectory(moduleCachePath)
759764
let main = path.appending(component: "testExplicitModuleBuildEndToEnd.swift")
760765
try localFileSystem.writeFileContents(main) {
761766
$0 <<< "import C;"
@@ -773,7 +778,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
773778
var driver = try Driver(args: ["swiftc",
774779
"-I", cHeadersPath.nativePathString(escaped: true),
775780
"-I", swiftModuleInterfacesPath.nativePathString(escaped: true),
776-
"-explicit-module-build",
781+
"-explicit-module-build", "-v",
782+
"-module-cache-path", moduleCachePath.nativePathString(escaped: true),
777783
"-working-directory", path.nativePathString(escaped: true),
778784
main.nativePathString(escaped: true)] + sdkArgumentsForTesting,
779785
env: ProcessEnv.vars)

0 commit comments

Comments
 (0)