XCTest should allow you to run each test case or test method on its own process

Originator:bkbeachlabs
Number:rdar://FB7610608 Date Originated:Mar 2, 2020
Status:Open Resolved:
Product:iOS & iPadOS Product Version:
Classification: Reproducible:
 
Basic Information
Please provide a descriptive title for your feedback:
XCTest should allow you to run each test case or test method on its own process
Which area are you seeing an issue with?
‌Something else not on this list
What type of feedback are you reporting?
Suggestion
Description
Please describe the issue and what steps we can take to reproduce it:
This would allow you to use Xcode and XCTest to write what people call "integration tests" or "end-to-end" or "system tests", for SDKs, Frameworks or APIs, without the need for a UI.

Currently all XCTest cases are instantiated at the beginning of the test run and sequentially executed in the same process memory space. If they were on separate processes, with separate memory, they could be better isolated from interfering with each other. In many use cases (such as integration tests), the performance cost of using new memory is acceptable in exchange for the benefit of this isolation.

Currently a workaround is to write a UITest target with a text field where I use automated UI touches to enter an enum value, then read that in the application and run a test case. The test can still be written in XCTestCase classes if you embed the XCTest framework into a test app. You write a new App target just for these tests. And the `XCUIApplication().launch()` UI method in the UITest bundle lets you create a new process.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!