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:
parent
79d35109f0
commit
3069167dd4
1 changed files with 17 additions and 15 deletions
|
|
@ -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() \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue