Apparently, only Kennedy's answer answered your question. Nevertheless, I want to offer a completely different approach.
I use the gtest method for RecordProperty() to create an additional description attribute in the XML of the test log and just pass it a brief description of what the test method performs as a string literal. I created a small macro called TEST_DESCRIPTION , which should be called as the first statement in any test case:
#define TEST_DESCRIPTION(desc) RecordProperty("description", desc) TEST(MyTest, SecondTest) { TEST_DESCRIPTION("This test does 'stuff'");
In addition, I have a simple XSLT transform that creates an HTML test report from the output of an XML test and shows this @description attribute.
The disadvantage of this method is that the description attribute will not be displayed for disabled tests, since RecordProperty() will not be executed for them.
All this was invented, since my boss asked for descriptions of unit test cases, and I didn’t want to describe them in a separate tool (for example, we have Polarion for analyzing requirements, and you can also describe test cases there), because this, likely to become inconsistent quickly.
But perhaps doxygen may provide additional benefits, as it is able to display call links from your testing methods.
source share