Testify 将 XCTest 的输出转换为适当的结构(JSON、JUNIT、MD、GFM),否则就会惨败。 😉
您可以使用命令行工具将测试结果实时转换为 JSON、JUNIT、MD 和 GFM 格式。
git clone https://github.com/BinaryBirds/Testify.git && cd Testify
make install
which testify
要通过 Mint 安装 BinaryBirds/Testify,只需使用
$ mint run BinaryBirds/Testify
在您的项目文件夹中运行
swift test | testify json
swift test | testify junit
swift test | testify md
swift test | testify gfm
您可以像往常一样使用 Swift Package Manager
.package(url: "https://github.com/binarybirds/testify", from: "1.2.0"),
import Testify
let suite = TestSuite.parse("test-output-string")