简体   繁体   English

为什么XCode 6测试导航器不使用XCTest但使用SenTestingKit?

[英]Why the XCode 6 test Navigator does not use XCTest but SenTestingKit?

Any Test class I create from the Tests Navigator (the plus (+) button on the left bottom), it add: #import <SenTestingKit/SenTestingKit.h> instead of XCTest. 我从“测试导航器”(左下方的加号(+)按钮)创建的任何Test类都添加: #import <SenTestingKit/SenTestingKit.h>而不是XCTest。

  • This is my Xcode version: Version 6.1.1 (6A2008a) 这是我的Xcode版本:6.1.1版(6A2008a)

Note: This is an existing project, old ones which I recently updated to use ARC instead of MRC, it is up and running and GHUnit ( https://github.com/gh-unit/gh-unit ) was working on it, I've removed GHUnit in order to use XCTest. 注意:这是一个现有项目,我最近将其更新为使用ARC而不是MRC的旧项目,它已启动并正在运行,并且GHUnit( https://github.com/gh-unit/gh-unit )正在研究中,我删除了GHUnit以便使用XCTest。

These are the steps: 这些步骤是:

  1. From the project navigator I click the + button to add a "New Test Class". 在项目导航器中,单击+按钮以添加“新测试类”。 在此处输入图片说明

  2. I set the Class name... 我设置了班级名称... 在此处输入图片说明

  3. Set where the class will be saved... 设置课程的保存位置... 在此处输入图片说明

  4. The file is created, however instead of import XCTest it does import SenTestKit =( 文件已创建,但是不是导入XCTest,而是导入SenTestKit =( 在此处输入图片说明

    • However it creates properly if I create the class using: File > New > File then select "Test Case Class" click "Next" set the class name, the screen is different, it show a "Subclass of" dropdown and XCTestCase is selected on it: 但是,如果我使用以下方法创建类,则它会正确创建:文件>新建>文件,然后选择“测试用例类”,然后单击“下一步”,设置类名称,屏幕有所不同,它显示一个“子类”下拉列表,并且选择了XCTestCase它: 在此处输入图片说明

    • Then the XCTest class is created properly: 然后,正确创建XCTest类: 在此处输入图片说明

This what I did trying to solve the issue: 这就是我试图解决该问题的方法:

  • Did check if the test bundle "Wrapper Extension" was set to xctest (yeah it is) 是否检查了测试包“包装扩展程序”是否设置为xctest(是的)
  • Reinstalled my Xcode 重新安装我的Xcode
  • Took the opportunity to upgrade to Yosemite =D 获得升级到优胜美地= D的机会

Did not solve the issue. 没有解决问题。 This happens even if I create a new project :( 即使我创建一个新项目,也会发生这种情况:(

Any thoughts? 有什么想法吗?

I did contact Apple and looks likes this is a bug on XCode. 我确实联系了Apple,看来这是XCode上的错误。

You can see the thread here: https://devforums.apple.com/message/1094651#1094651 您可以在这里看到线程: https : //devforums.apple.com/message/1094651#1094651

Also, these steps can be used as an workaround: 此外,这些步骤也可以用作解决方法:

File > New > File then select "Test Case Class" click "Next" set the class name. File> New> File,然后选择“ Test Case Class”,单击“ Next”设置类名。

The Test Class will be created properly. 测试类将被正确创建。

I will post more details here once the Apple people update the bug I did report. 一旦Apple人员更新了我报告的错误,我将在此处发布更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM