gpt4 book ai didi

ios - CocoaPods 单元测试问题

转载 作者:搜寻专家 更新时间:2023-11-01 05:44:11 34 4
gpt4 key购买 nike

我刚刚创建了一个 Cocoapods 库,并想为该特定库(不是示例项目)设置一个测试目标。

这里有一些问题:

1) Is there a default testing target created by default for the library ? If not, why ?


2) I created a testing target (if my assumption about 1) is correct that there is no testing target created on library creation), how do I test the library while my main Library Scheme is selected ?


3) Do I have to add all the source files that need to be tested to my testing target in order to test them ?

最佳答案

编辑

我误解了这个问题,从上面的评论中可以清楚地看出这一点。如果您在框架上有一个测试目标,并将所有必需的源代码添加到构建阶段的编译源代码步骤中,您可以通过选择框架目标并使用 command-U 来进行测试。另一方面,据我所知,库将需要一个单独的测试目标,但您可以将其添加到库方案的测试阶段,以使用 command-U 并选择您的 lib 目标进行测试(见下文)。

Add sources to test to the testing target

Add test target to library scheme test phase

关于ios - CocoaPods 单元测试问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34337272/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com