I am new to using Google test framework for unit testing and am intending to generate an XML report of the tests or the command output as a report (I could just print it obviously). I have read up on Generate XML Report , but haven't been able to understand clearly on how to go about generating the report. Any help would be greatly appreciated.
Cheers.
Right click on project and go to properties. Go to Configuration Properties->Debugging. In Command Arguments add --gtest_output="xml:\home\user\XML_Report. xml"
GTest is objected oriented tool and C language isn't! from GTest website gmock_for_dummies.md so you will use only macros like expect_equal, expect_bigger_than and so on... I would like to suggest you tool CMocka (or some other C unit testing tools).
Add a Google Test project in Visual Studio 2022 In Solution Explorer, right-click on the solution node and choose Add > New Project. Set Language to C++ and type test in the search box. From the results list, choose Google Test Project. Give the test project a name and choose OK.
For Linux environments:
It's simple you just have to set the GTEST_OUTPUT environment variable like this: export GTEST_OUTPUT="xml:/home/user/src". or use the -gtest_output flag set the same way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With