Benchmark in Swift Testing

Swift Testing does not include benchmark test as far as I see the doc.
Do we still need to use XCTest for it? and will Swift Testing have benchmark suite as well in the future?

func testPerformanceExample() {
    self.measure {
    }
}
1 Like

I've moved this topic to the swift-testing subcategory.

There's also a Benchmark subcategory for ordo-one/package-benchmark.

1 Like

Performance testing is a future direction for Swift Testing. :slightly_smiling_face:

3 Likes

Thanks!

That's great to hear that! I'll look forward to it. Do you know the milestone?
Also, hopefully, Swift Testing support XCTAssertEqual(_:_:accuracy:_:file:line:) too.

Quoting the Swift Testing documentation:

The testing library doesn’t provide an equivalent of XCTAssertEqual(_:_:accuracy:_:file:line:). To compare two numeric values within a specified accuracy, use isApproximatelyEqual() from swift-numerics.

1 Like

Yep, I noticed it. That's why I hope it will support it.
The doc doesn't specify Swift Testing won't support it at all or just temporality doesn't support it.

We have no plans at this time to add the described interface. We recommend using swift-numerics instead. :slightly_smiling_face:

2 Likes