#shell #script #junit #output #results #systems #ci-cd

app shunit

一个实用程序,可以运行一系列shell脚本,并以JUnit格式输出结果,以便在CI/CD系统中轻松使用

1 个不稳定版本

0.2.0 2022年6月4日
0.1.1 2022年6月4日

#680测试

自定义许可

13KB
261

README

shunit 运行一系列shell脚本,并以JUnit格式输出结果,以便在CI/CD系统中轻松使用。

用法

$ cargo install shunit
$ shunit --help
USAGE:
    shunit [FLAGS] [OPTIONS] [scripts]...

FLAGS:
    -h, --help       Prints help information
    -q, --quiet      Silence all output
    -V, --version    Prints version information
    -v, --verbose    Verbose mode (-v, -vv, -vvv, -vvvv). The levels are warnings, informational, debugging, and trace
                     message

OPTIONS:
    -o, --output <output>    An optional target file to write the result to
    -t, --timestamp <ts>     Timestamp (sec, ms, ns, none)

ARGS:
    <scripts>...    Test scripts

示例

要运行 test 文件夹中的测试并生成JUnit兼容的XML输出,请运行

shunit -o shunit.xml test/*

这将生成一个名为shunit.xml的JUnit兼容输出文件。文件通配符会展开到测试目录中的每个脚本,因此最终的套件将包含运行所有4个文件的结果(包括不是脚本的文件)。

shunit的退出码在所有测试都成功时为0,否则为1。

依赖项

~6–13MB
~138K SLoC