简体   繁体   中英

Exclude tests from xctool

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?

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).

在此输入图像描述

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 .

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.

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