Skip to content

Commit 33ea130

Browse files
committed
remove Resources. Fix FooTestSuite
1 parent 82a562f commit 33ea130

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Fixtures/SwiftTesting/SingleTarget/Tests/LinuxMain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22

3-
@testable import Footest
3+
@testable import FooTestSuite
44

55
XCTMain([
66
testCase(SimpleGetTests.allTests),

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)