Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I run an XCTest suite multiple times?

Is it possible to have Xcode run your unit tests multiple times?

I had an issue in several unit tests that caused intermittent failures. Now that I think I've fixed it, my only option appears to mash + U until I'm 95% confident the bug is gone.

I know other unit testing frameworks make it quite easy to run a single test, test case, or test suite multiple times. Do we have this luxury in XCTest yet?

like image 246
T Blank Avatar asked Jul 02 '15 22:07

T Blank


People also ask

What is XCTest used for?

Overview. Use the XCTest framework to write unit tests for your Xcode projects that integrate seamlessly with Xcode's testing workflow. Tests assert that certain conditions are satisfied during code execution, and record test failures (with optional messages) if those conditions aren't satisfied.

How do I skip XCTest?

You can disable XCTests run by Xcode by right clicking on the test symbol in the editor tray on the left. You'll get this menu, and you can select the "Disable " option. Right clicking again will allow you to re-enable. Also, as stated in user @sethf's answer, you'll see entries for currently disabled tests in your .

Is XCTest a unit testing framework?

XCTest framework is one of those frameworks that enables its users to write basic unit, performance and some level of UI tests for iOS apps.


1 Answers

For me it works in swift

override func invokeTest() {
    for time in 0...15 {
        print("this test is being invoked: \(time) times")
        super.invokeTest()
    }
}
like image 194
Sultan Ali Avatar answered Oct 11 '22 05:10

Sultan Ali