Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

c++ - How to import Google Tests xml results to VSTS

We use Google Test (gtest) for tests in our C++ based solution. We build it in VSTS to run on Windows. When we run test .exe it produces test_detail.xml file with results of the test run:

<?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" />
...

How to import this file to VSTS?

It would be ideal if gtests are recognized and displayed on build Summary page, even if it's just passfail, no details of the errors.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Turned out that the format of test_detail.xml (report produced by gtest) is JUnit, so it's very easy to import into VSTS, as described here: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-java


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...