Reverting - Don't trap exceptions in unit tests when in debug mode (reverse-merged from commit 51a7c8e209bafd889982f21e0e40a034afdb36d6)
parent
9ec3c45201
commit
96b20487a9
|
@ -57,9 +57,20 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
/**
|
||||
* Normal test will wrap execution in a try/catch block to catch exceptions more effectively
|
||||
*/
|
||||
#define TEST(testName, testGroup)\
|
||||
class testGroup##testName##Test : public Test \
|
||||
{ public: testGroup##testName##Test () : Test (#testName "Test", __FILE__, __LINE__, true) {} \
|
||||
virtual ~testGroup##testName##Test () {};\
|
||||
void run (TestResult& result_);} \
|
||||
testGroup##testName##Instance; \
|
||||
void testGroup##testName##Test::run (TestResult& result_)
|
||||
|
||||
/**
|
||||
* For debugging only: use TEST_UNSAFE to allow debuggers to have access to exceptions, as this
|
||||
* will not wrap execution with a try/catch block.
|
||||
* will not wrap execution with a try/catch block
|
||||
*/
|
||||
#define TEST_UNSAFE(testName, testGroup)\
|
||||
class testGroup##testName##Test : public Test \
|
||||
|
@ -69,23 +80,6 @@ protected:
|
|||
testGroup##testName##Instance; \
|
||||
void testGroup##testName##Test::run (TestResult& result_)
|
||||
|
||||
/**
|
||||
* Normal test will wrap execution in a try/catch block to catch exceptions
|
||||
* more effectively (except in debug mode where they will be uncaught to pass on
|
||||
* to the debugger.)
|
||||
*/
|
||||
#ifdef NDEBUG
|
||||
#define TEST(testName, testGroup)\
|
||||
class testGroup##testName##Test : public Test \
|
||||
{ public: testGroup##testName##Test () : Test (#testName "Test", __FILE__, __LINE__, true) {} \
|
||||
virtual ~testGroup##testName##Test () {};\
|
||||
void run (TestResult& result_);} \
|
||||
testGroup##testName##Instance; \
|
||||
void testGroup##testName##Test::run (TestResult& result_)
|
||||
#else
|
||||
#define TEST TEST_UNSAFE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convention for tests:
|
||||
* - "EXPECT" is a test that will not end execution of the series of tests
|
||||
|
|
Loading…
Reference in New Issue