I’m not an XCTest expert, but I see that
-recordFailureWithDescription:inFile:atLine:expected:method that looks like it was specifically designed for this job.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"