Added StringMaker (for partially specialising string conversions), extended BDD macros and moved file/line info to top of message.

Re-enable ANSI colour by default - hopefully properly excluding Windows this time
This commit is contained in:
Phil Nash
2013-03-04 12:19:15 +01:00
parent ead139e094
commit 767f1588dc
14 changed files with 952 additions and 872 deletions

View File

@@ -14,11 +14,14 @@
// !TBD: story scenarios map to class based tests
#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
#define GIVEN( desc ) SECTION( " Given: " desc, "" )
#define WHEN( desc ) SECTION( " When: " desc, "" )
#define THEN( desc ) SECTION( " Then: " desc, "" )
#define GIVEN( desc ) SECTION( "Given: " desc, "" )
#define WHEN( desc ) SECTION( " When: " desc, "" )
#define AND_WHEN( desc ) SECTION( " And: " desc, "" )
#define THEN( desc ) SECTION( " Then: " desc, "" )
#define AND_THEN( desc ) SECTION( " And: " desc, "" )
inline bool itDoesThis(){ return true; }
inline bool itDoesThat(){ return true; }
SCENARIO( "Do that thing with the thing", "[tags]" ) {
GIVEN( "This stuff exists" ) {
@@ -26,7 +29,11 @@ SCENARIO( "Do that thing with the thing", "[tags]" ) {
WHEN( "I do this" ) {
// do this
THEN( "it should do this")
{
REQUIRE( itDoesThis() );
AND_THEN( "do that")
REQUIRE( itDoesThat() );
}
}
}