Skip to content

[Integration Tests] Calculate the swiftRootDir more accurately #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Tests/SwiftDriverTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,17 @@ final class IntegrationTests: IntegrationTestCase {
return
}

/// The root directory, where build/, llvm-project/, and swift/ live.
let swiftRootDir = packageDirectory.parentDirectory

// SWIFT_DRIVER_LIT_DIR may be relative or absolute. If it's
// relative, it's relative to the parent directory of the package. If
// you've cloned this package into a Swift compiler working directory,
// that means it'll be the directory with build/, llvm/, swift/, and
// swift-driver/ in it.
let litConfigDir = AbsolutePath(
litConfigPathString,
relativeTo: packageDirectory.parentDirectory
relativeTo: swiftRootDir
)

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

/// The root directory, where build/, llvm-project/, and swift/ live.
let swiftRootDir = swiftBuildDir.parentDirectory.parentDirectory.parentDirectory

/// The path to lit.py.
let litFile = swiftRootDir.appending(components: "llvm-project", "llvm", "utils", "lit",
"lit.py")
Expand Down