Add partial implementation of CATCH_CONFIG_DISABLE

* Assertions are defined into (void)(0) no-op
* SECTIONs are defined away (leaving {} as scope)
* TEST_CASEs and TEST_CASE_METHODs are not registered.
* REGISTER_TEST_CASE is defined into (void)(0) no-op
* METHOD_AS_TEST_CASE is defined away
This commit is contained in:
Martin Hořeňovský
2017-08-27 17:03:32 +02:00
parent 2a13593885
commit 053c29a2b8
5 changed files with 165 additions and 0 deletions

View File

@@ -12,6 +12,8 @@
#include "catch_message.h"
#include "catch_interfaces_capture.h"
#if !defined(CATCH_CONFIG_DISABLE)
#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
#define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
#else
@@ -157,5 +159,6 @@
INTERNAL_CATCH_REACT( catchAssertionHandler ) \
} while( Catch::alwaysFalse() )
#endif // CATCH_CONFIG_DISABLE
#endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED

View File

@@ -47,6 +47,19 @@ struct AutoReg : NonCopyable {
} // end namespace Catch
#if defined(CATCH_CONFIG_DISABLE)
#define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
static void TestName()
#define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
namespace{ \
struct TestName : ClassName { \
void test(); \
}; \
} \
void TestName::test()
#endif
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
static void TestName(); \