Right now, XCTMain() returns Never and calls exit() to report its status. This makes it difficult (if not outright impossible) to do any post-test cleanup work like writing an event log or other cleanup.
This PR adds a new overload of XCTMain() that instead returns the intended exit code of the process (as CInt, since process exit codes passed to exit() are always of type int in C.) The new overload is, for now, disfavoured until we can teach SwiftPM about it. Once we can (in a subsequent PR), we'll mark the old one disfavored and deprecated.
Right now,
XCTMain()
returnsNever
and callsexit()
to report its status. This makes it difficult (if not outright impossible) to do any post-test cleanup work like writing an event log or other cleanup.This PR adds a new overload of
XCTMain()
that instead returns the intended exit code of the process (asCInt
, since process exit codes passed toexit()
are always of typeint
in C.) The new overload is, for now, disfavoured until we can teach SwiftPM about it. Once we can (in a subsequent PR), we'll mark the old one disfavored and deprecated.