-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gtest_output support #81
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
The merging of the xml fails, if one of the tests crashes the test itself. Which happens for me with glog and CHECK(...). This creates a SIGABRT. The merge fails because no xml is created for that test. |
this would be a great feature for running tests on jenkins. |
I've merged the master branch and resolved the conflicts. I also skip now files which are empty (0 bytes) when e.g. Suggestions are welcome. Greetings |
'''join given files into a single one''' | ||
from xml.dom import minidom | ||
|
||
files = [f for f in files if os.path.exists(f) and os.path.getsize(f) > 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you insert a TODO to revisit how empty files / crashes are handled and highlight that we skip that for now?
Also could we make sure to print a summary of how many tests failed to generate output? I think this may go through list of files before stripping out the !exists/empty ones. It would be OK to print every single failure here I think and not necessarily print x/y tests aborted. Can we get the test name corresponding to the failure as well?
Sorry for the slow response I've been more busy than I'd like. Can we make sure this error handling is explicit (by comments and printing which tests aborted and that they're therefore not present in the xml output)? |
Hi @pbos , I will check it (hopefully in the next couple of days). |
Such a helpful feature! @tonka3000 I'm just wondering if you had a chance or if you are planning to finish a work on this PR, so it gets merged? |
Hey @mr1sunshine , never found the time to finish the PR. Work drifted to different technology and I used gtest rarely since the shift. |
This PR add support for
gtest_output
xml format.gtest support
--gtest_output
to save files as xml. An example would bemy.exe --gtest_output=xml:myfile.xml
. gtest-parallel does not support this option right now, but it would be very practical to have support for it because many CI systems like e.g. GitLab CI support artifact upload to visualize the test results in a project.How a user can use this option
I've added and
--gtest_output
option which is very similar to the original one.Example:
--gtest_output xml:myfile.xml
How is it implemented
I save the gtest xml file for every exectuable run in temp files and join them together after all tasks have finished. This way I get the original content of the gtest xml output which be joined together.
Greetings
Michael