Googletest: Add "filename" field to XML output

Created on 16 Oct 2015  Â·  8Comments  Â·  Source: google/googletest

currently when saving results as xml the there is no indication of what file the test was located in

<testsuite name="NAME" tests="3" failures="0" disabled="0" errors="0" time="0.328">

adding a "filename" attribute would be extremely helpful with some automated reporting tools.

<testsuite name="NAME" tests="3" failures="0" disabled="0" errors="0" time="0.328" filename="/home/user/project/test/file.cpp">

All 8 comments

On Thu, Oct 15, 2015 at 6:19 PM, Curtis Mahieu [email protected]
wrote:

currently when saving results as xml the there is no indication of what
file the test was located in

adding a "filename" attribute would be extremely helpful with some
automated reporting tools.

Tests can come from many files that are all linked in into the same binary.
Maybe it would work in the nodes, but I fear it will be too
verbose and give a lot of duplicated attributes.

_Sam

—
Reply to this email directly or view it on GitHub
https://github.com/google/googletest/issues/613.

"testcase" would also be fine. This can be accomplished now by using

  RecordProperty("fileName", __FILE__);

There is no way to globally add this to every test. It has to be added to every Fixture or TEST by hand, and is very error prone.

Maybe if there could be a global flag that would call RecordProperty in the macro code for TEST or for every Fixture?

By now, is there a way to write the file name to the XML output in an automated way? Besides adding a RecordProperty statement to each test?

Is any progress here?

I'm joining request

I would also love to be able to automatically record the test location in the xml output.

1658 is almost what i was looking for, but that only seems to print the file information when using "--gtest_list_tests" I was looking for that same information but in addition to the actual test result information as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebioman picture ebioman  Â·  3Comments

pepe82sh picture pepe82sh  Â·  5Comments

qiuxin picture qiuxin  Â·  5Comments

octoploid picture octoploid  Â·  3Comments

marknelson picture marknelson  Â·  4Comments