Exclude tests from xctool

371 views Asked by At

Is it possible to exclude a specific unit test or test suite from xctool?

I noticed that xctool allows me to specify specific tests to run with the -only flag. I would like to do the opposite.

The reason is that some tests require components that are not available in the console test environment.

If there is no flag to do this (I couldn't find any in the documentation), what would be the best alternative?

2

There are 2 answers

0
hpique On BEST ANSWER

I solved this by creating a new scheme (RMStoreExcludeKeychingTests) including the same targets from the original scheme and excluding the offending tests (shown below in Xcode 5).

enter image description here

Finally, I told xctool to use the new scheme for testing. This way, if I add new tests and code I don't have to make any changes to the schemes or targets.

In case it's of any help, the schemes can be found here and the Travis CI configuration with the xctool invocation here.

0
PatrickNLT On

There is an omit command now.

From the doc:

-omit SPEC                 SPEC is TARGET[:Class/case[,Class2/case2]]; use * when specifying class or case prefix.