From 2150f9c8a5020ccadb9e5b2be760c40860d325e0 Mon Sep 17 00:00:00 2001 From: very0228 Date: Tue, 6 Jun 2023 03:14:16 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A1=86=E6=9E=B6=E5=AF=B9=E5=A4=96?= =?UTF-8?q?=E8=B5=84=E6=96=99=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: very0228 --- README_zh.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README_zh.md b/README_zh.md index 6388494..3758e8f 100755 --- a/README_zh.md +++ b/README_zh.md @@ -994,6 +994,10 @@ subsystem # 子系统 run -t UT -cov coverage run -t UT -ra random run -t UT -tp PartName -pd partdeps + run -t UT -ts base_object_test --repeat 5 + run -hl + run -rh 3 + run --retry ``` @@ -1004,10 +1008,14 @@ subsystem # 子系统 -tm [TESTMODULE]: 指定模块,不可独立使用,需结合-tp指定上级部件使用。 -ts [TESTSUITE]: 指定测试套,可独立使用。 -tc [TESTCASE]: 指定测试用例,同时需要注明测试套内class名称,不可独立使用,需结合-ts指定上级测试套使用。 - -cov [COVERAGE]: 覆盖率执行参数 + -cov [COVERAGE]: 覆盖率执行参数。 -h : 帮助命令 -ra [random]: c++用例乱序执行参数 -pd [partdeps]: 二级依赖部件执行参数 + --repeat : 支持设置用例执行次数。 + -hl [HISTORYLIST]: 显示最近10条测试用例,超过10条,只显示最近10条。 + -rh [RUNHISTORY]: 执行历史记录的第几条记录运行 + --retry:检查上次运行结果,如果有失败用例则重复测试 ``` @@ -1067,6 +1075,10 @@ subsystem # 子系统 run -t -cov coverage run -t UT -ra random run -t UT -tp PartName -pd partdeps + run -t UT -ts base_object_test --repeat 5 + run -hl + run -rh 3 + run --retry ``` 执行命令参数说明: ``` @@ -1079,6 +1091,10 @@ subsystem # 子系统 -h : 帮助命令 -ra [random]: c++用例乱序执行参数 -pd [partdeps]: 二级依赖部件执行参数 + --repeat : 支持设置用例执行次数。 + -hl [HISTORYLIST]: 显示最近10条测试用例,超过10条,只显示最近10条。 + -rh [RUNHISTORY]: 执行历史记录的第几条记录运行 + --retry:检查上次运行结果,如果有失败用例则重复测试 ``` 在linux下可以使用help命令查看有哪些产品形态、测试类型、支持的子系统、部件 -- Gitee From e49f74ff4495cb237f3b44b6dbd110c521a5ca12 Mon Sep 17 00:00:00 2001 From: very0228 Date: Tue, 6 Jun 2023 08:17:17 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: very0228 --- src/core/command/run.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/command/run.py b/src/core/command/run.py index 57f0caf..a2a50c6 100644 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -173,10 +173,12 @@ class Run(object): print(child.tag, ":", child.attrib) for grand in child: print(grand.tag, ":", grand.attrib) - if grand.attrib["result"] == 'false': - fail_case = grand.attrib["classname"] + "#" + grand.attrib["name"] - fail_list.append(fail_case) - has_failed_case += 1 + for sub_child in grand: + if sub_child.tag == 'failure': + fail_case = grand.attrib["classname"] + "#" + grand.attrib["name"] + fail_list.append(fail_case) + has_failed_case += 1 + break test_targets["class"] = fail_list setattr(options, "testargs", test_targets) print("retry option:", options) -- Gitee