XCTest - “Test failed”

后端 未结 3 546
暗喜
暗喜 2021-01-04 20:25

I\'m trying to add tests to a mac app. I\'m using XCTest framework. When i run tests (cmd + U) i receive \"Test failed\" and in console I see :

2013-10-15 13         


        
相关标签:
3条回答
  • 2021-01-04 21:05

    I was facing a different issue but was seeing the same log. For the problem was that the deployment target of the tests target was higher than the iOS version of the simulator that I was trying to use.

    I hope this helps someone.

    0 讨论(0)
  • 2021-01-04 21:09

    You need to disable code signing in order to run unit tests. This page explains how to create a configuration for testing so that your debug and release applications are code signed but your unit tests are not. Don't forget to do a full clean after changing the configuration.

    0 讨论(0)
  • 2021-01-04 21:25

    I had the same "no suitable image found" issue when was trying to add tests to an existing ios project. Try to go to Build Settings of your Tests target and set "Build Active Architecture Only" to "No". This solved my issue.

    Also, make sure you have the same Architecture for both targets or you'll get strange linker errors.

    0 讨论(0)
提交回复
热议问题