Showing individual #expect() / XCTAssert() successes in unit tests

Is it possible to see not just failures but the individual successes (of #expect() / XCTAssert()), e.g. in Xcode's console? Or even in the UI? Either in XCTest or in the new swift testing is good for me.

Swift Testing does have the ability to deliver what it calls "expectation checked events" for every expectation (e.g. #expect) that it evaluates, regardless of whether it passed or failed. (For context, the code to control that functionality is here.) That said, it's disabled currently and there is no way to enable or "opt-in" to emitting those events. It's mostly there to assist with validating the testing library itself, via the library's own unit tests, although a few have expressed interest in exposing this functionality to end users.

The main reason it hasn't been exposed as a proper feature thus far is because integrated tools and IDEs are not well equipped to handle such events, especially due to their higher volume compared to other kinds (since an individual test can potentially contain many expectations). If you are interested in seeing this become a properly supported feature though, I'd encourage filing a GitHub issue in the swift-testing repo.

There is no analogous functionality in XCTest, and I'm not sure what "UTTTest" is—can you clarify that one?

UTTTest

oops, I meant the new swift testing, corrected above.

I just hoped there's some built-in switch to flip to avoid doing the print myself.

I'm also implementing the "warning" log entries in my tests: i.e. it's not a failure, but not a full success either.