Skip to content

Commit c373ff9

Browse files
committed
remove Resources
1 parent 82a562f commit c373ff9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Tests/Functional/Utilities.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,21 @@ func executeSwiftBuild(chdir: String, configuration: Configuration = .Debug, pri
131131
}
132132
}
133133

134+
//FIXME: rafactor to use a common dir for swift-build and swift-test
135+
func swiftTestPath() -> String {
136+
#if os(OSX)
137+
for bundle in NSBundle.allBundles() where bundle.bundlePath.hasSuffix(".xctest") {
138+
return Path.join(bundle.bundlePath.parentDirectory, "swift-test")
139+
}
140+
fatalError()
141+
#else
142+
return Path.join(try! Process.arguments.first!.abspath().parentDirectory, "swift-test")
143+
#endif
144+
}
145+
134146
//TODO: refactor swift-build and swift-test tools runing
135147
func executeSwiftTest(dir: String, printIfError: Bool = false) throws -> String {
136-
let toolPath = Resources.findExecutable("swift-test")
148+
let toolPath = swiftTestPath()
137149
let env = [String:String]()
138150
let args = [toolPath]
139151

0 commit comments

Comments
 (0)