Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2013-03-16 20:39:19 +0000
committerPhil Nash2013-03-16 20:39:19 +0000
commit444f4ddc602018e2093c90ed5d28fe2b2c66a911 (patch)
tree19673a8d8a15e70e9e19d7b0be65af004c90fa51 /include
parent9390675260ac8b0906a6846c82f8113224fc2c7a (diff)
downloadcatch3-444f4ddc602018e2093c90ed5d28fe2b2c66a911.tar.gz
Variadics support for BDD macros (scenarios)
Diffstat (limited to 'include')
-rw-r--r--include/catch.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/catch.hpp b/include/catch.hpp
index 8f74962b..7a95541c 100644
--- a/include/catch.hpp
+++ b/include/catch.hpp
@@ -104,7 +104,11 @@
#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
// "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 )
+#endif
#define CATCH_GIVEN( desc ) CATCH_SECTION( "Given: " desc, "" )
#define CATCH_WHEN( desc ) CATCH_SECTION( " When: " desc, "" )
#define CATCH_AND_WHEN( desc ) CATCH_SECTION( " And: " desc, "" )
@@ -165,7 +169,11 @@
#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
// "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 )
+#endif
#define GIVEN( desc ) SECTION( "Given: " desc, "" )
#define WHEN( desc ) SECTION( " When: " desc, "" )
#define AND_WHEN( desc ) SECTION( " And: " desc, "" )