SenTest OCUnit in Xcode 4

I was not able to find the latest information on using OCUnit tests with Xcode 4, even if it is a modified feature.

Apples own documentation in the Organizer since 2005 (OS X 10.3).

I thought I was just going and trying to set it up myself.

1: Created a new test target. (TestUnit)

2: Make sure that all basic SDK settings in the project and goals are set to iOS 4.3.

3: added test class

4: Make sure the search path in the wireframe points to the frame folder

(4.1?) Manually added the SenTesting framework to my testTarget

When I install my circuit on "TestUnit iOS 4.3 Simulator" and try to run it, I get an error message: "The selected destination is not valid for this action."

I have no idea whether it would be more accurate to add OCUnit testing for Xcode 4, so if someone has a resource or steps can be specified, I would be grateful.

Thanks in advance.

+7
source share
3 answers

In Xcode 4, 'longpress' on the run button until a drop-down list appears and select a test.

+6
source

The following steps helped me add unit testing to the iPhone project running in the simulator:

  • Add the Cocoa Touch Unit Testing project object to the project. Adding a goal added a single test class to the project.
  • Change the application schema to run unit tests. This included adding the target test unit to the test step of the circuit. I used the application schema for unit test instead of the unit test schema, adding Xcode when adding the target test unit.
  • Choose Product> Test.

You do not need to add SenTesting structure to your project. Also, make sure that the test host build option is empty if you are testing an iPhone application running in a simulator. The simulator does not support unit tests hosted on the server.

+4
source

In addition, to exclude the message "The selected launch task is not valid for this action", when you are in the UnitTest target program, open its Biuld diagram and select "Run"

0
source

All Articles