mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
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:
@@ -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
|
||||
|
@@ -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(); \
|
||||
|
Reference in New Issue
Block a user