Skip to content

Commit 404b186

Browse files
authored
Use different bundle to lookup resources for SwiftPM.
Differential Revision: D71950105 Pull Request resolved: #9702
1 parent 50f57fd commit 404b186

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

extension/apple/ExecuTorch/__tests__/ModuleTest.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class ModuleTest: XCTestCase {
3030
}
3131

3232
func testLoadMethod() {
33-
let bundle = Bundle(for: type(of: self))
34-
guard let modelPath = bundle.path(forResource: "add", ofType: "pte") else {
33+
guard let modelPath = resourceBundle.path(forResource: "add", ofType: "pte") else {
3534
XCTFail("Couldn't find the model file")
3635
return
3736
}
@@ -41,8 +40,7 @@ class ModuleTest: XCTestCase {
4140
}
4241

4342
func testMethodNames() {
44-
let bundle = Bundle(for: type(of: self))
45-
guard let modelPath = bundle.path(forResource: "add", ofType: "pte") else {
43+
guard let modelPath = resourceBundle.path(forResource: "add", ofType: "pte") else {
4644
XCTFail("Couldn't find the model file")
4745
return
4846
}
@@ -53,8 +51,7 @@ class ModuleTest: XCTestCase {
5351
}
5452

5553
func testExecute() {
56-
let bundle = Bundle(for: type(of: self))
57-
guard let modelPath = bundle.path(forResource: "add", ofType: "pte") else {
54+
guard let modelPath = resourceBundle.path(forResource: "add", ofType: "pte") else {
5855
XCTFail("Couldn't find the model file")
5956
return
6057
}

0 commit comments

Comments
 (0)