# Import gtest xml output as JUnit

**URL:** https://www.finalbuilder.com/forums/t/import-gtest-xml-output-as-junit/6483
**Category:** Discussion
**Tags:** implemented
**Created:** [April 30, 2019, 1:47pm UTC](https://www.finalbuilder.com/forums/t/import-gtest-xml-output-as-junit/6483 "2019-04-30T13:47:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Chingle](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@Chingle](https://www.finalbuilder.com/forums/u/Chingle)
#### Post date: [April 30, 2019, 1:47pm UTC](https://www.finalbuilder.com/forums/t/import-gtest-xml-output-as-junit/6483/1 "2019-04-30T13:47:43Z")

</div>

Hi,

We’re running our C++ UnitTests with Google Test. Now we want to import the test results as XML into our Continua CI. Google Tests generates mostly JUnit compatible XML-output, so we can use the “Import JUnit Tests” action and it works. But we couldn’t figure out to what value (if any) the “assembly” column is mapped to. Is there anyway to set the assembly name when importing UnitTest results from a xml file? It would make filtering tests a lot easier.

gtest outputs xml like the following:

> ```
> <?xml version="1.0" encoding="UTF-8"?>
> <testsuites\>
> <testsuite name="TestFixtureName" tests="4" failures="0" errors="0" skipped="0" time="0.001" timestamp="2019-04-09T19:23:58">
> <testcase classname="TestFixtureName" name="ValueExists" time="0.001" />
> <testcase classname="TestFixtureName" name="SetValue" time="0" />
> <testcase classname="TestFixtureName" name="GetValue" time="0" />
> <testcase classname="TestFixtureName" name="assignment" time="0" />
> </testsuite>
> <testsuite name="TestFixtureName2" tests="2" failures="0" errors="0" skipped="0" time="0.001" timestamp="2019-04-09T19:25:00">
> <testcase classname="Namespace.TestFixtureName2" name="ChangeValue" time="0.001" />
> <testcase classname="Namespace.TestFixtureName2" name="DeleteValue" time="0" />
> </testsuite>
> </testsuites>
> 
> ```

And look in Continua like this (after “Import JUnit Tests”):

 ![gtest_import_result](https://www.finalbuilder.com/forums/uploads/default/original/2X/e/e3dbdb8493e2f06dbdc61606b6ebf72ac54d8f64.png)

Any help would be greatly appreciated 🙂  
Julian

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [May 1, 2019, 2:06am UTC](https://www.finalbuilder.com/forums/t/import-gtest-xml-output-as-junit/6483/2 "2019-05-01T02:06:03Z")

</div>

Hi Julian,

The action currently looks for a `package` attribute on the `testsuite` element which is optional according to the [JUnit XML reporting file format](https://llg.cubic.org/docs/junit/).

We have just uploaded [new versions](https://www.finalbuilder.com/downloads/continuaci) (v1.9.0.430 and v1.9.1.170 Beta) of Continua CI. These versions include additional Import JUnit Tests settings to will allow you choose to use the filename or a specified value when this attribute is missing (or always).

---

<div class="post-metadata">

### Author: ![Chingle](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/7ab992/32.png) [@Chingle](https://www.finalbuilder.com/forums/u/Chingle)
#### Post date: [May 1, 2019, 9:50am UTC](https://www.finalbuilder.com/forums/t/import-gtest-xml-output-as-junit/6483/3 "2019-05-01T09:50:51Z")

</div>

Hi Sparky,

Thank you for your quick response and of course for this quick update!  
I will have to install the new version and have a go at it.
