Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法忽略特定的测试用例而不注释掉它?
一些测试是在实现存在之前编写的,所以在提交任何代码之前,我想首先标记这些测试被忽略,这样我的任何同事都不会感到震惊。
将它们注释掉会导致丢失失败的、不完整的测试。
您可以右键单击左侧面板中的测试并选择“禁用”。
在 OCUnit (SenTestingKit) 中没有内置的方法来注释测试。
一种方法是更改测试方法的名称。我在要禁用但希望它继续编译的测试的开头添加了“XXX”。例如,
- (void)XXXtestSomething
然后我可以搜索“XXXtest”来查找所有禁用的测试方法。
这应该可以通过“其他测试标志”构建设置来实现。和
-SenTest ClassToTest
您可以指定要测试的类,但不能指定单个方法。
更多信息可以在这里找到:快速单元测试,红色毛衣