3232// If you wish to disable AND, OR macro
3333// #define ZEROERR_DISABLE_COMPLEX_AND_OR
3434
35+ // If you wish ot disable BDD style macros
36+ // #define ZEROERR_DISABLE_BDD
3537
3638// Detect C++ standard with a cross-platform way
3739
@@ -3625,7 +3627,7 @@ ZEROERR_SUPPRESS_COMMON_WARNINGS_PUSH
36253627
36263628#define SUB_CASE (name ) \
36273629 zeroerr::SubCase (name, __FILE__, __LINE__, _ZEROERR_TEST_CONTEXT) \
3628- << [=](ZEROERR_UNUSED(zeroerr::TestContext * _ZEROERR_TEST_CONTEXT))
3630+ << [=](ZEROERR_UNUSED(zeroerr::TestContext * _ZEROERR_TEST_CONTEXT)) mutable
36293631
36303632#define ZEROERR_CREATE_TEST_CLASS (fixture, classname, funcname, name ) \
36313633 class classname : public fixture { \
@@ -3647,6 +3649,12 @@ ZEROERR_SUPPRESS_COMMON_WARNINGS_PUSH
36473649
36483650#define ZEROERR_HAVE_SAME_OUTPUT _ZEROERR_TEST_CONTEXT->save_output ();
36493651
3652+ #ifndef ZEROERR_DISABLE_BDD
3653+ #define SCENARIO (...) TEST_CASE(" Scenario: " __VA_ARGS__)
3654+ #define GIVEN (...) SUB_CASE(" given: " __VA_ARGS__)
3655+ #define WHEN (...) SUB_CASE(" when: " __VA_ARGS__)
3656+ #define THEN (...) SUB_CASE(" then: " __VA_ARGS__)
3657+ #endif
36503658
36513659namespace zeroerr {
36523660
@@ -4929,6 +4937,7 @@ void TestContext::reset() {
49294937static inline std::string getFileName (std::string file) {
49304938 std::string fileName (file);
49314939 auto p = fileName.find_last_of (' /' );
4940+ if (p == std::string::npos) p = fileName.find_last_of (' \\ ' );
49324941 if (p != std::string::npos) fileName = fileName.substr (p + 1 );
49334942 return fileName;
49344943}
0 commit comments