#smol #summary #cargo-test #output #json #size #terminal-size

app cargo-smol

一个将 cargo-test 封装的 cargo 命令,使用 JSON 输出以提供摘要

4 个版本

0.2.0 2020年1月31日
0.1.2 2019年9月8日
0.1.1 2019年9月8日
0.1.0 2019年9月8日

#680 in Cargo 插件

MIT 许可证

210KB
353

最小的测试报告器

cargo-smol 接收 cargo test --format json 的输出并将其格式化为一个小区域。

注意:由于 json 格式尚未稳定,smol 需要 -Z unstable-options

通常,smolwatch 配合使用,以便在文件更改时重新运行。在您的项目中尝试此操作: cargo watch -x smol

如果所有测试都通过,这将显示出来

screenshot of smol in action

如果您的测试失败,您应该看到如下内容

screenshot of smol with a couple of failed test cases

smol 只会显示能放入其所在窗口大小的测试用例。任何额外的测试都不会列出,但会包含在测试摘要状态行中。

当前版本:v0.1.1

技术细节

关于 cargo-watch 的工作方式阻止将终端切换到原始模式。因此,我们无法完全控制终端。我们尽力而为,但可能存在错误。

我知道目前有几个测试用例失败。

依赖项

~1.9–3MB
~60K SLoC