As of Swift 5.4, building before testing seems to fail:
BytesTests.swift:2:18: error: module 'BytesTests' was not compiled for error: module 'BytesTests' was not compiled for testing
@testable import BytesTests
~~~~~~~~~~ ^
It seems to be down to using the release configuration: swift build --build-tests --enable-index-store --configuration release
See Also: