我的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控制台启动器识别。我需要选择同时标记为A和B的测试。是否支持?有什么想法吗?
答案 0 :(得分:0)
从https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher复制
-t, --include-tag=TAG
提供标签或标签表达式以仅包含标签匹配的测试。重复此选项时,所有模式都将使用OR语义进行组合。
这表示支持“标签表达”。
您只需要说服OS / shell命令将A&B
字符串作为单个参数传递而没有引号即可。
注意:您还需要传递与您的测试类相匹配的类名过滤器模式,例如--include-classname .*Class?
或等到1.7.0-M2发布:https://github.com/junit-team/junit5/issues/2259