'Module was not compiled for testing' when using @testable

前端 未结 10 882
难免孤独
难免孤独 2020-12-04 14:00

I\'m trying to use Swift 2\'s new @testable declaration to expose my classes to the test target. However I\'m getting this compiler error:

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 14:32

    I started getting this error when running tests using Bitrise.

    Unlike other users says, this is not per Target basis, or per Schema basis, it is per Configuration basis. Select Target -> Build Settings tab -> look for testability -> Enable it on the Configuration that you are using.

    Please notice that Apple recommends to enable this on the configuration that you are using for debugging, not for AppStore.

提交回复
热议问题