Skip to content

Commit 41647b4

Browse files
authored
Merge pull request #518 from porglezomp-misc/swift-driver-integration-tests-you-know-the-root-already
[Integration Tests] Calculate the swiftRootDir more accurately
2 parents 0edc9d3 + e95f51b commit 41647b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SwiftDriverTests/IntegrationTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,17 @@ final class IntegrationTests: IntegrationTestCase {
149149
return
150150
}
151151

152+
/// The root directory, where build/, llvm-project/, and swift/ live.
153+
let swiftRootDir = packageDirectory.parentDirectory
154+
152155
// SWIFT_DRIVER_LIT_DIR may be relative or absolute. If it's
153156
// relative, it's relative to the parent directory of the package. If
154157
// you've cloned this package into a Swift compiler working directory,
155158
// that means it'll be the directory with build/, llvm/, swift/, and
156159
// swift-driver/ in it.
157160
let litConfigDir = AbsolutePath(
158161
litConfigPathString,
159-
relativeTo: packageDirectory.parentDirectory
162+
relativeTo: swiftRootDir
160163
)
161164

162165
/// The site config file to use.
@@ -168,9 +171,6 @@ final class IntegrationTests: IntegrationTestCase {
168171
/// The path to the real frontend we should use.
169172
let frontendFile = swiftBuildDir.appending(components: "bin", "swift")
170173

171-
/// The root directory, where build/, llvm-project/, and swift/ live.
172-
let swiftRootDir = swiftBuildDir.parentDirectory.parentDirectory.parentDirectory
173-
174174
/// The path to lit.py.
175175
let litFile = swiftRootDir.appending(components: "llvm-project", "llvm", "utils", "lit",
176176
"lit.py")

0 commit comments

Comments
 (0)