When do app sources need to be included in test targets?

前端 未结 7 1608
别那么骄傲
别那么骄傲 2020-12-02 05:30

In a new project I have this simple test

#import 
#import \"ViewController.h\"

@interface ViewControllerTests : XCTestCase
@end

@imp         


        
7条回答
  •  伪装坚强ぢ
    2020-12-02 06:06

    In my case in Xcode 6.2 was error in different architectures in project target and tests target.

    Project target has only armv7 and armv7s architectures (because of some older library)

    Project Tests target has armv7, armv7s and arm64 architectures.

    Removing arm64 architecture solve this issue for my case.

    Project Editor -> Project Tests target -> Build Settings -> Valid Architectures = armv7 armv7s
    

    (perhaps it is needed also to set "Architectures" instead of $(ARCHS_STANDARD) to $(ARCHS_STANDARD_32_BIT))

提交回复
热议问题