mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-23 05:46:11 +01:00
Variadics support for BDD macros (scenarios)
This commit is contained in:
parent
9390675260
commit
444f4ddc60
@ -104,7 +104,11 @@
|
|||||||
#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
|
#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
|
||||||
|
|
||||||
// "BDD-style" convenience wrappers
|
// "BDD-style" convenience wrappers
|
||||||
|
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||||
|
#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
|
||||||
|
#else
|
||||||
#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags )
|
#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags )
|
||||||
|
#endif
|
||||||
#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" )
|
#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" )
|
||||||
#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" )
|
#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" )
|
||||||
#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" )
|
#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" )
|
||||||
@ -165,7 +169,11 @@
|
|||||||
#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
|
#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
|
||||||
|
|
||||||
// "BDD-style" convenience wrappers
|
// "BDD-style" convenience wrappers
|
||||||
|
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||||
|
#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
|
||||||
|
#else
|
||||||
#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
|
#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
|
||||||
|
#endif
|
||||||
#define GIVEN( desc ) SECTION( "Given: " desc, "" )
|
#define GIVEN( desc ) SECTION( "Given: " desc, "" )
|
||||||
#define WHEN( desc ) SECTION( " When: " desc, "" )
|
#define WHEN( desc ) SECTION( " When: " desc, "" )
|
||||||
#define AND_WHEN( desc ) SECTION( " And: " desc, "" )
|
#define AND_WHEN( desc ) SECTION( " And: " desc, "" )
|
||||||
|
Loading…
Reference in New Issue
Block a user