简体   繁体   中英

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.

  • This is my Xcode version: Version 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.

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 =( 在此处输入图片说明

    • 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: 在此处输入图片说明

    • Then the XCTest class is created properly: 在此处输入图片说明

This what I did trying to solve the issue:

  • Did check if the test bundle "Wrapper Extension" was set to xctest (yeah it is)
  • Reinstalled my Xcode
  • Took the opportunity to upgrade to Yosemite =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.

You can see the thread here: 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.

The Test Class will be created properly.

I will post more details here once the Apple people update the bug I did report.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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