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

3

7

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.

Taylor answered 24/10, 2012 at 10:40 Comment(0)
I
12

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

Internecine answered 14/4, 2015 at 15:8 Comment(0)
M
3

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.

Misvalue answered 25/10, 2012 at 4:42 Comment(2)
Also thought of using this approach, but the feedback with this approach isn't ideal. Would've been great if OCUnit had a mechanism.Taylor
Just use Xcode to disable tests. See @user3308049's answer.Cadency
F
0

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

Faithless answered 28/1, 2013 at 16:12 Comment(1)
thanks, but it still runs other tests. (Just ignore results of them...)Steinbok

© 2022 - 2024 — McMap. All rights reserved.