What is the order of calling XCTest test functions in Xcode 8?

XCTest test functions(also classes) was called in alphabetical order (before Xcode 8). With Xcode 8, I can not assume in which order the test cases are called by the system.

Can someone throw some light on it?

Posted on Sep 29, 2016 4:08 AM

Reply
2 replies

Sep 29, 2016 8:39 AM in response to Rajkanth

There is no official order, test methods should be written so that they can be run in any order. This is needed when using Xcode to manually run single test methods to e.g. speed up the debug/test cycle when fixing a buggy method.


A test class can implement -setUp and -tearDown to setup/clean up the test environment before and after each test method run. There are also +setUp and +tearDown methods to do the same on a per test class level.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

What is the order of calling XCTest test functions in Xcode 8?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.