mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
console reporter:
Always print test case + sections in header for every new section. Group sections into single block Tweaked BDD mappings to print out nicely with above
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,31 +12,22 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#define STORY( a, b )
|
||||
#define SCENARIO( storyName, desc ) TEST_CASE( desc, "" )
|
||||
#define GIVEN( desc ) SECTION( desc, "" )
|
||||
#define WHEN( desc ) SECTION( desc, "" )
|
||||
#define THEN( desc ) SECTION( desc, "" )
|
||||
// !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, "" )
|
||||
|
||||
inline bool itDoesThis(){ return true; }
|
||||
|
||||
STORY( storyName, "once upon a time" )
|
||||
|
||||
SCENARIO( storyName, "scenario name" )
|
||||
{
|
||||
GIVEN( "This stuff exists" )
|
||||
{
|
||||
SCENARIO( "Do that thing with the thing", "[tags]" ) {
|
||||
GIVEN( "This stuff exists" ) {
|
||||
// make stuff exist
|
||||
|
||||
WHEN( "I do this" )
|
||||
{
|
||||
WHEN( "I do this" ) {
|
||||
// do this
|
||||
|
||||
THEN( "it should do this")
|
||||
{
|
||||
REQUIRE( itDoesThis() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user