To be fair, this is how all test runners should work. A crash within a test case shouldn't prevent all the test suite to be tested. XCTest does it.
It's quite unfortunate XCTest doesn't support expected crashes, there is a big room for improvement here.
Also, it's a bad idea to try to restore a program after one of the threads(or coroutines) has entered an unrecoverable state. Swift (as well as most of other languages) doesn't provide instruments to isolate one part of the program from the others. So, while you can easily trap a faulty thread, you'll end up with leaked resources(heap objects, file handles, locks, etc) that thread was responsible for releasing (for more info on the subject search for reasons why Thread.stop() was deprecated in Java for example). To do it properly you should let the program die and delegate all the cleaning to the OS.
11 Likes