@Suite
is modelled at runtime as an instance of Test
whose isSuite
property has a value of true
—the difference between @Suite
and @Test
is one of syntactic sugar, for the most part. So the instance of test
you are given in this context should refer to your suite.
(Be aware that there's a known issue in the implementation of CustomExecutionTrait
that may cause it to execute at the wrong time relative to a suite.)
A formalized interface for running code before/after a suite is tracked by API or mechanism to perform an action once before/after running all of the tests in a suite type · Issue #36 · apple/swift-testing · GitHub.