Junit Console Launcher .. 支持标签表达式

Junit Console Launcher .. support for tag expressions

我的 junit-console-launcher 命令有点像,

java -jar ./junit-platform-console-standalone.jar -cp 。 -c pkg.Class1 -c pkg1.Class2 -t A --details=verbose

我这样做是因为我需要按特定顺序发送 类。我在使用此处记录的标签表达式方面需要帮助, https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions

-t 'A & B' 似乎无法被 junit 控制台启动器识别。我需要 select 标记为 A 和 B 的测试。这受支持吗?有什么想法吗?

复制自https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher

-t, --include-tag=TAG

Provide a tag or tag expression to include only tests whose tags match. When this option is repeated, all patterns will be combined using OR semantics.

这表示支持 "tag expression"。

您只需要说服您的 OS/shell 命令将 A&B 字符串作为不带引号的单个参数传递。

注意:您还需要传递一个 class 匹配您的测试 classes 的名称过滤器模式,例如 --include-classname .*Class? 或等到 1.7.0 -M2发布:https://github.com/junit-team/junit5/issues/2259