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:
@@ -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() \
|
||||
|
Reference in New Issue
Block a user