我们在基于C的解决方案中使用Google Test(gtest)进行测试 . 我们在VSTS中构建它以在Windows上运行 . 当我们运行test .exe时,它会生成带有测试运行结果的 test_detail.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1152" failures="0" disabled="0" errors="0" time="8.57" name="AllTests">
<testsuite name="testTrim" tests="10" failures="0" disabled="0" errors="0" time="0.041">
<testcase name="trimEmptyString" status="run" time="0" classname="testTrim" />
...
如何将此文件导入VSTS?
如果在构建摘要页面上识别并显示gtests,那将是理想的,即使它只是传递\ fail,也没有错误的详细信息 .
1 回答
原来, test_detail.xml (由gtest生成的报告)的格式为 JUnit ,因此很容易导入VSTS,如下所述:https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-java