如何将 Google 测试 xml 结果导入 VSTS

How to import Google Tests xml results to VSTS

我们在基于 C++ 的解决方案中使用 Google 测试 (gtest) 进行测试。 我们在 VSTS 中将其构建为 Windows 上的 运行。 当我们 运行 测试 .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?

如果 gtest 能够被识别并显示在构建摘要页面上,那将是理想的,即使它只是 pass\fail,没有错误的详细信息。

原来test_detail.xml(gtest出的报告)的格式是JUnit,所以很容易导入 VSTS,如下所述: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-java