KIF XCTest.dylib test suite not loading when using Swift

I am trying to add new tests in Swift to an existing KIF test suite currently written in Objective C.

Setting:

  • Xcode 6.4
  • cocoapods 0.37.2
  • The subfile uses the latest KIF version

I have set the Swift bridge title by importing KIF and other relevant parts of my project to make them available to Swift.

I've reduced everything to a simple test case that doesn't even use KIF at this point:

import Foundation

class MyFirstTest : KIFTestCase {

    func testOne() {
        NSLog("Done")
    }
}

      

The test suite builds fine, but when I run I get:

2015-07-03 14: 52: 32.620 MyApp [1104: 204793] Error loading / private / var / mobile / Containers / Data / Application / F 20A664E-BD2D-4299-A93F-4C6758CBAF34 / tmp / MyApp_UI_Tests.xctest / MyApp_UI_Tests: dlopen (/private/var/mobile/Containers/Data/Application/F20A664E-BD2D-4299-A93F-4C6758CBAF34/tmp/MyApp_UI_Tests.xctest/MyApp_UI_Tests, 262): Library not loaded: @ rCpathTest / libswift dylib

Link to: /private/var/mobile/Containers/Data/Application/F20A664E-BD2D-4299-A93F-4C6758CBAF34/tmp/MyApp_UI_Tests.xctest/MyApp_UI_Tests

Reason: Image not found DevToolsBundleInjection: Error loading package // privat / var / mobile / Containers / Data / Application / F 20A664E-BD2D-4299-A93F-4C6758CBAF34 / tmp / MyApp_UI_Tests.xctest '

I've tried suggestions here , including:

  • Configuring Startup Path Search Paths to @ executable_path / Frameworks for both the application and target test build
  • Setting "Embedded content contains quick code" to YES

I've also tried:

  • Full cocoapods clean up and restore project / workspace
  • Removing all DerivedData and running a clean build

I have also seen suggestions that it might have to do with code signing identification, but the package cannot load the dev id on the simulator as well as on the real device.

If I go back to just using Objective C tests, everything is fine.

What did I miss?

+3


source to share


1 answer


Finally figured it out. For me, the solution was to make sure @ loader_path / Frameworks as well as @ executable_path / Frameworks are enabled for the target test suite path parameter .

Once I added everything loaded fine.



enter image description here

+8


source







All Articles