Situation:
Consider an ios/swift/app that is being tested using xcode/XCTests. The app also includes some logging to console (and to Google/Firebase/Crashlytics as nonfatal exceptions: works great!).
For this a custom written logging class is being used that accepts logging as debug, info and error. The point: it's easy to add some custom code each time an error log is being done.
Question:
When, during XCTests, an error is being logged, we want to send this to the running XCTest so that the XCTest can see this as a failure. Basically this means we need a way to send information from the app under test back to the running XCTest.
We thought about using the notification center but this does not apply because the XCTest is not running in the app's process. How could this be done?
I suggest you try several options: