Do set the current test name when running the tests

The variables and helper TempStringAssign class were added in order to
implement this, but somehow it was never done, so wxGetCurrentTestName()
always returned an empty string.

Fix this and so store the class/method name of the currently running
test in the global variables to give more context, notably for GTK+
errors.
This commit is contained in:
Vadim Zeitlin
2017-11-07 02:52:06 +01:00
parent 79d35109f0
commit 3069167dd4

View File

@@ -202,22 +202,24 @@ inline std::string wxGetCurrentTestName()
public: \
void runTest() wxOVERRIDE \
{ \
struct EatNextSemicolon
using namespace wxPrivate; \
TempStringAssign setClass(wxTheCurrentTestClass, #testclass)
#define CPPUNIT_TEST(testname) \
SECTION(#testname) \
{ \
setUp(); \
try \
{ \
testname(); \
} \
catch ( ... ) \
{ \
tearDown(); \
throw; \
} \
tearDown(); \
#define CPPUNIT_TEST(testname) \
SECTION(#testname) \
{ \
TempStringAssign setMethod(wxTheCurrentTestMethod, #testname); \
setUp(); \
try \
{ \
testname(); \
} \
catch ( ... ) \
{ \
tearDown(); \
throw; \
} \
tearDown(); \
}
#define CPPUNIT_TEST_SUITE_END() \