Schoob
Schoob

Reputation: 1718

XCode 4 Unit test: Is it possible to ignore certain test cases?

Is there a way of ignoring a specific test case without commenting it out?

Some tests are written before the implementation exists, so before commiting any code I'd like to first flag these tests to be ignored so it doesn't appal any of my colleagues.

Commenting them out results in loosing track of failing, incomplete tests.

Upvotes: 7

Views: 3529

Answers (3)

TheObviousRobot
TheObviousRobot

Reputation: 121

You can right click on the test in the left panel and select "Disable ".

Upvotes: 12

myell0w
myell0w

Reputation: 2200

This should be possible with the "Other Test Flags" build setting. with

 -SenTest ClassToTest 

you can specify the classes to test, but not individual methods.

More information can be found here: Fast Unit Testing, Red Sweater

Upvotes: 0

Jon Reid
Jon Reid

Reputation: 20980

There's no built-in way to annotate tests in OCUnit (SenTestingKit).

One approach is to change the name of the test method. I add 'XXX' to the beginning of a test I want to disable but want it to keep compiling. For example,

- (void)XXXtestSomething

Then I can search for 'XXXtest' to find all disabled test methods.

Upvotes: 3

Related Questions