Can I run an XCTest suite multiple times?
Try overriding invoke test: https://developer.apple.com/documentation/xctest/xctestcase/1496282-invoketest?language=objc
- (void)invokeTest{ for (int i=0; i<100; i++) { [super invokeTest]; }}
For me it works in swift
override func invokeTest() { for time in 0...15 { print("this test is being invoked: \(time) times") super.invokeTest() }}
It might help you to use
func testMultiple() { self.measureBlock() { ... XCTAssert(errMessage == nil, "no error expected") }}
This runs the code inside self.measureBlock() multiple times to measure the average time.
It is work to change the code, but you might want to know the execution time anyways.
This answer might be close enough to what you want and it is easy to do.