XML从Google测试中生成没有显示跳过的测试用例
我正在使用Google测试框架在C ++中进行单元测试。在测试名称之前,我很少使用禁用的测试用例,并且使用GTEST_SKIP()跳过了一些测试。这很好,我可以看到在Teminal日志中被禁用并跳过的测试。问题是当我从测试中生成XML文件时。
我正在使用以下命令。
--gtest_output=xml:/data/TestReport.xml
生成的XML
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="17" failures="7" disabled="3" errors="0" time="57.713" timestamp="1970-01-04T10:31:55" name="AllTests">
<testsuite name="UNITTEST" tests="17" failures="7" disabled="3" errors="0" time="45.713" timestamp="1970-01-04T10:32:04">
<testcase name="Test_1" status="run" result="skipped" time="0" timestamp="1970-01-04T10:32:04" classname="UNITTEST" />
<testcase name="Test_2" status="run" result="completed" time="0.461" timestamp="1970-01-04T10:32:04" classname="UNITTEST" />
<testcase name="Test_3" status="run" result="completed" time="7.089" timestamp="1970-01-04T10:32:05" classname="UNITTEST">
我想指出的是, 是整合所有测试套件的标签测试套件不会跳过属性。 所有测试的合并的标签测试套件也没有跳过属性。但是,测试_1确实显示了跳过的结果。是否有任何配置可以使跳过的计数出现。
谢谢。
I am using google test framework for doing unit testing in c++. I have few test cases which i have disabled using DISABLED_ before test name and some tests are skipped using GTEST_SKIP(). This is working fine and i can see the tests being disabled and skipped in the teminal log. The problem is when i am generating the xml file from the test.
I am using the following command.
--gtest_output=xml:/data/TestReport.xml
The generated XML
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="17" failures="7" disabled="3" errors="0" time="57.713" timestamp="1970-01-04T10:31:55" name="AllTests">
<testsuite name="UNITTEST" tests="17" failures="7" disabled="3" errors="0" time="45.713" timestamp="1970-01-04T10:32:04">
<testcase name="Test_1" status="run" result="skipped" time="0" timestamp="1970-01-04T10:32:04" classname="UNITTEST" />
<testcase name="Test_2" status="run" result="completed" time="0.461" timestamp="1970-01-04T10:32:04" classname="UNITTEST" />
<testcase name="Test_3" status="run" result="completed" time="7.089" timestamp="1970-01-04T10:32:05" classname="UNITTEST">
I would like to point out that the tag testsuites which is a consolidation of all the testsuite does not have an attribute skipped.
The tag testsuite which is a consolidation of all the tests also does not have the attribute skipped. However, the test Test_1 does show the result as skipped. Is there any configuration to make the count of skipped appear.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是版本问题。我正在吐口水,添加了在这里。标签
testsuite
跳过
为我跳过:这是我运行的示例: https://godbolt.org/z/9aw7gryfj
确保您正在运行最新版本。
It's probably a version issue. I'm gussing it was added here. The tag
testsuite
hasskipped
for me:This is the example that I ran: https://godbolt.org/z/9aW7GrYfj
Make sure you are running the latest release.