Files
SwiftLint/Tests/TestHelpers/TestResources.swift
Danny Mösch 15b285527a Separate built-in rule tests from framework tests (#5924)
* Short names for test modules
* Lint plugins and `Package.swift` in integration tests
* Simplify and merge file groups in Bazel
* Move common functions to `TestHelpers`
2024-12-30 12:26:46 +01:00

15 lines
564 B
Swift

import Foundation
public enum TestResources {
public static func path(_ calleePath: String = #filePath) -> String {
let folder = URL(fileURLWithPath: calleePath, isDirectory: false).deletingLastPathComponent()
if let rootProjectDirectory = ProcessInfo.processInfo.environment["BUILD_WORKSPACE_DIRECTORY"] {
return "\(rootProjectDirectory)/Tests/\(folder.lastPathComponent)/Resources"
}
return folder
.appendingPathComponent("Resources")
.path
.absolutePathStandardized()
}
}