comipayan / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

XML output is missing an "s" #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a C++ file that includes gtest/gtest.h
2. Two or more test cases, with one more more tests each
3. Compile and link with both gtest and gtest_main
4. Run your app with --gtest_output=xml
5. Open the generated test_detail.xml

What is the expected output? What do you see instead?
The resulting XML will look similar to this:
<testsuite ...>
  <testsuite ...>
  </testsuite>
  <testsuite ...>
  </testsuite>
</testsuite>

When I tried to make Hudson (https://hudson.dev.java.net/) parse this as 
JUnit test result it did not find any testcases, the problem was that 
first line of <testsuite ...> which should be <testsuites ...> (as it 
contains a number of test suites)

What version of the product are you using? On what operating system?
I'm running version 1.1.0 on an old Tru64 Unix machine, and compiled 
googletest using GCC 4.2.3

Original issue reported on code.google.com by mathias....@gmail.com on 27 Nov 2008 at 7:46

GoogleCodeExporter commented 9 years ago
This is by design.

The xml output we based on was from the "junit" ant task, which produces 
separate xml 
files for different testsuites. There is another ant task "junitreport", which 
takes 
all the xml files and combine them into one using xslt. It's the "junitreport" 
task 
that creates the top level "testsuits" element.

Original comment by shiq...@gmail.com on 2 Dec 2008 at 4:51

GoogleCodeExporter commented 9 years ago
I've set up an ant task to convert the xml output into a single XML report, 
like so:

    <junitreport>
      <fileset dir="${basedir}/tests">
        <include name="*.xml"/>
      </fileset>
      <report format="frames" todir="${basedir}/tests"/>
    </junitreport>

...and then I told Hudson to use TESTS-TestSuite.xml as the junit test result.  
Yet, it still is telling me that 
none of the files contained any results, exactly the same result as when I 
point it towards the raw XML output 
generated by gtest.  Why is this?

Original comment by njreiman@gmail.com on 29 Dec 2008 at 2:35