We are using Catch as testing framework and are quite satisfied with its usability.
I'm planning to implement a series of simple unit tests for a new chart widget. The chart widget can be only tested properly by simple image comparisons.
For this I need to compare the current image of the widget with a previously archived reference image. Now, I need to invent a filename for every test section, which is quite cumbersome and should be done automatically.
It is possible to derive the current SECTION
in a TEST_CASE
as a string?
The following example illustrates, what I wanted to achieve:
TEST_CASE("A") {
SECTION("B") {
SECTION("C") {
std::string uniqueName=currentSection();
}
}
}
Now, uniqueName
should at best contain something like A.B.C
, but something unique would also suffices, if it stays the same after extending the test.