From 67ccd8d74ab395fb196840c6f292a74c06507567 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 26 Jan 2013 20:06:55 +0000 Subject: [PATCH] Allows console line width to be configured (and defaults to 80). Line wrap is at console width-1 --- include/internal/catch_config.hpp | 4 + include/reporters/catch_reporter_console.hpp | 11 +- .../SelfTest/Baselines/approvedResults.txt | 660 +++++++++--------- 3 files changed, 338 insertions(+), 337 deletions(-) diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 72059f1f..1ef3fff6 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -18,6 +18,10 @@ #include #include +#ifndef CATCH_CONFIG_CONSOLE_WIDTH +#define CATCH_CONFIG_CONSOLE_WIDTH 80 +#endif + namespace Catch { struct Include { enum WhichResults { diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index e6c58ceb..8deefd33 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -199,7 +199,7 @@ namespace Catch { } static std::string wrapLongStrings( std::string const& _string ){ - return Catch::wrapLongStrings( _string, 70, 2 ); + return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 ); } std::ostream& stream; @@ -330,18 +330,15 @@ namespace Catch { stream << getDashes() << "\n"; } static std::string const& getDashes() { - static const std::string dashes - = "-----------------------------------------------------------------"; + static const std::string dashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '-' ); return dashes; } static std::string const& getDots() { - static const std::string dots - = "................................................................."; + static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '.' ); return dots; } static std::string const& getDoubleDashes() { - static const std::string doubleDashes - = "================================================================="; + static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' ); return doubleDashes; } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 10d03a66..78475fcb 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -2,9 +2,9 @@ CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/simple -................................................................. +............................................................................... PASSED: REQUIRE( d == Approx( 1.23 ) ) @@ -42,9 +42,9 @@ with expansion: Approx( 1.23 ) != 1.24 ApproxTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/epsilon -................................................................. +............................................................................... PASSED: REQUIRE( d != Approx( 1.231 ) ) @@ -58,9 +58,9 @@ with expansion: 1.23 == Approx( 1.231 ) ApproxTests.cpp:39: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/float -................................................................. +............................................................................... PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -74,9 +74,9 @@ with expansion: 0 == Approx( 0 ) ApproxTests.cpp:50: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/int -................................................................. +............................................................................... PASSED: REQUIRE( 1 == Approx( 1 ) ) @@ -86,9 +86,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ApproxTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/mixed -................................................................. +............................................................................... PASSED: REQUIRE( 1.0f == Approx( 1 ) ) @@ -120,9 +120,9 @@ with expansion: 1.234 == Approx( 1.234 ) ApproxTests.cpp:79: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/custom -................................................................. +............................................................................... PASSED: REQUIRE( d == approx( 1.23 ) ) @@ -172,9 +172,9 @@ with expansion: Approx( 1.23 ) != 1.25 ApproxTests.cpp:101: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( s == "hello" ) @@ -182,9 +182,9 @@ with expansion: "hello" == "hello" ClassTests.cpp:24: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/TestClass/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( s == "world" ) @@ -192,9 +192,9 @@ with expansion: "hello" == "world" ClassTests.cpp:28: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( m_a == 1 ) @@ -202,9 +202,9 @@ with expansion: 1 == 1 ClassTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Fixture/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( m_a == 2 ) @@ -212,9 +212,9 @@ with expansion: 1 == 2 ClassTests.cpp:55: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/equality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven == 7 ) @@ -258,9 +258,9 @@ with expansion: 1.3 == Approx( 1.3 ) ConditionTests.cpp:63: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/equality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven == 6 ) @@ -340,9 +340,9 @@ with expansion: 1.3 == Approx( 1.301 ) ConditionTests.cpp:85: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/inequality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven != 6 ) @@ -410,9 +410,9 @@ with expansion: 5 != 6 ConditionTests.cpp:103: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/inequality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven != 7 ) @@ -444,9 +444,9 @@ with expansion: 5 != 5 ConditionTests.cpp:115: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/ordered -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven < 8 ) @@ -550,9 +550,9 @@ with expansion: "hello" > "a" ConditionTests.cpp:144: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/ordered -................................................................. +............................................................................... FAILED: CHECK( data.int_seven > 7 ) @@ -668,9 +668,9 @@ with expansion: "hello" <= "a" ConditionTests.cpp:174: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/int literals -................................................................. +............................................................................... PASSED: REQUIRE( i == 1 ) @@ -750,9 +750,9 @@ with expansion: 0x > 4 ConditionTests.cpp:202: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions//long_to_unsigned_x -................................................................. +............................................................................... PASSED: REQUIRE( long_var == unsigned_char_var ) @@ -778,9 +778,9 @@ with expansion: 1 == 1 ConditionTests.cpp:226: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/const ints to int literal -................................................................. +............................................................................... PASSED: REQUIRE( unsigned_char_var == 1 ) @@ -806,9 +806,9 @@ with expansion: 1 == 1 ConditionTests.cpp:240: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/negative ints -................................................................. +............................................................................... PASSED: CHECK( ( -1 > 2u ) ) @@ -846,9 +846,9 @@ with expansion: -2147483648 > 2 ConditionTests.cpp:254: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/computed ints -................................................................. +............................................................................... PASSED: CHECK( 54 == 6*9 ) @@ -856,9 +856,9 @@ with expansion: 54 == 54 ConditionTests.cpp:269: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/ptr -................................................................. +............................................................................... PASSED: REQUIRE( p == __null ) @@ -908,9 +908,9 @@ with expansion: 0 != 0x ConditionTests.cpp:302: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/not -................................................................. +............................................................................... PASSED: REQUIRE( false == false ) @@ -954,9 +954,9 @@ with expansion: !(1 == 2) ConditionTests.cpp:326: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/not -................................................................. +............................................................................... FAILED: CHECK( false != false ) @@ -1000,9 +1000,9 @@ with expansion: !(1 == 1) ConditionTests.cpp:343: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/explicit -................................................................. +............................................................................... PASSED: REQUIRE_THROWS_AS( thisThrows() ) @@ -1016,9 +1016,9 @@ PASSED: REQUIRE_THROWS( thisThrows() ) ExceptionTests.cpp:41: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/explicit -................................................................. +............................................................................... FAILED: CHECK_THROWS_AS( thisThrows() ) @@ -1037,18 +1037,18 @@ due to unexpected exception with message: expected exception ExceptionTests.cpp:49: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/implicit -................................................................. +............................................................................... FAILED: due to unexpected exception with message: unexpected exception ExceptionTests.cpp:52: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/implicit/2 -................................................................. +............................................................................... PASSED: CHECK( 1 == 1 ) @@ -1060,25 +1060,25 @@ due to unexpected exception with message: unexpected exception ExceptionTests.cpp:60: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/implicit -................................................................. +............................................................................... No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom -................................................................. +............................................................................... FAILED: due to unexpected exception with message: custom exception ExceptionTests.cpp:102: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/nothrow -................................................................. +............................................................................... FAILED: REQUIRE_NOTHROW( throw CustomException( "unexpected custom exception" ) ) @@ -1086,9 +1086,9 @@ due to unexpected exception with message: unexpected custom exception ExceptionTests.cpp:109: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/throw -................................................................. +............................................................................... FAILED: REQUIRE_THROWS_AS( throw CustomException( "custom exception - not std" ) ) @@ -1096,26 +1096,26 @@ due to unexpected exception with message: custom exception - not std ExceptionTests.cpp:114: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/exceptions/custom/double -................................................................. +............................................................................... FAILED: due to unexpected exception with message: 3.14 ExceptionTests.cpp:118: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/exceptions/notimplemented -................................................................. +............................................................................... PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) ExceptionTests.cpp:129: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/generators/1 -................................................................. +............................................................................... PASSED: CATCH_REQUIRE( multiply( i, 2 ) == i*2 ) @@ -1981,9 +1981,9 @@ with expansion: 214 == 214 GeneratorTests.cpp:27: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/generators/2 -................................................................. +............................................................................... PASSED: CATCH_REQUIRE( i->first == i->second-1 ) @@ -1997,9 +1997,9 @@ with expansion: 2 == 2 GeneratorTests.cpp:40: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message -................................................................. +............................................................................... warning: this is a warning @@ -2008,18 +2008,18 @@ MessageTests.cpp:14: No assertions in test case, './succeeding/message' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/succeed -................................................................. +............................................................................... PASSED: with message: this is a success MessageTests.cpp:18: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/info/1 -................................................................. +............................................................................... info: this message should be logged @@ -2035,9 +2035,9 @@ with expansion: 2 == 1 MessageTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/message/info/2 -................................................................. +............................................................................... PASSED: CHECK( a == 2 ) @@ -2075,29 +2075,29 @@ with expansion: 2 == 2 MessageTests.cpp:45: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/fail -................................................................. +............................................................................... FAILED: explicitly with message: This is a failure MessageTests.cpp:51: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/sections one -................................................................. +............................................................................... FAILED: explicitly with message: Message from section one MessageTests.cpp:58: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/message/sections two -................................................................. +............................................................................... FAILED: explicitly with message: @@ -2105,26 +2105,26 @@ explicitly with message: MessageTests.cpp:63: Message from section one ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message/sections/stdout one -................................................................. +............................................................................... No assertions in section, 'one' Message from section two ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/message/sections/stdout two -................................................................. +............................................................................... No assertions in section, 'two' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/message/scoped -................................................................. +............................................................................... PASSED: REQUIRE( i < 10 ) @@ -2202,9 +2202,9 @@ with expansion: 10 < 10 MessageTests.cpp:86: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/nofail -................................................................. +............................................................................... FAILED - but was ok: CHECK_NOFAIL( 1 == 2 ) @@ -2213,10 +2213,10 @@ MessageTests.cpp:92: No assertions in test case, './succeeding/nofail' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections s1 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2230,10 +2230,10 @@ with expansion: 2 != 1 MiscTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections s2 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2241,10 +2241,10 @@ with expansion: 1 != 2 MiscTests.cpp:31: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2258,11 +2258,11 @@ with expansion: 2 != 1 MiscTests.cpp:43: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/Sections/nested s1 s2 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2270,11 +2270,11 @@ with expansion: 1 != 2 MiscTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s2 -................................................................. +............................................................................... FAILED: REQUIRE( a == b ) @@ -2282,11 +2282,11 @@ with expansion: 1 == 2 MiscTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s3 -................................................................. +............................................................................... PASSED: REQUIRE( a != b ) @@ -2294,11 +2294,11 @@ with expansion: 1 != 2 MiscTests.cpp:66: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/nested2 s1 s4 -................................................................. +............................................................................... PASSED: REQUIRE( a < b ) @@ -2306,36 +2306,36 @@ with expansion: 1 < 2 MiscTests.cpp:70: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b c d (leaf) -................................................................. +............................................................................... No assertions in section, 'd (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b c e (leaf) -................................................................. +............................................................................... No assertions in section, 'e (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./Sections/nested/a/b f (leaf) -................................................................. +............................................................................... No assertions in section, 'f (leaf)' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/Sections/loops s1 -................................................................. +............................................................................... FAILED: CHECK( b > a ) @@ -2343,9 +2343,9 @@ with expansion: 0 > 1 MiscTests.cpp:103: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./mixed/Misc/loops -................................................................. +............................................................................... info: Testing if fib[0] (1) is even @@ -2429,16 +2429,16 @@ MiscTests.cpp:115: Some information An error ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/stdout,stderr -................................................................. +............................................................................... No assertions in test case, './succeeding/Misc/stdout,stderr' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Misc/null strings -................................................................. +............................................................................... PASSED: REQUIRE( makeString( false ) != static_cast(__null) ) @@ -2452,9 +2452,9 @@ with expansion: {null string} == {null string} MiscTests.cpp:134: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/info -................................................................. +............................................................................... info: hi @@ -2468,9 +2468,9 @@ FAILED: REQUIRE( false ) MiscTests.cpp:142: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/checkedif -................................................................. +............................................................................... PASSED: CHECKED_IF( flag ) @@ -2484,9 +2484,9 @@ with expansion: true MiscTests.cpp:155: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/checkedif -................................................................. +............................................................................... FAILED: CHECKED_IF( flag ) @@ -2500,9 +2500,9 @@ with expansion: false MiscTests.cpp:160: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/checkedelse -................................................................. +............................................................................... PASSED: CHECKED_ELSE( flag ) @@ -2516,9 +2516,9 @@ with expansion: true MiscTests.cpp:173: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/checkedelse -................................................................. +............................................................................... FAILED: CHECKED_ELSE( flag ) @@ -2532,25 +2532,25 @@ with expansion: false MiscTests.cpp:178: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./misc/xmlentitycheck embedded xml -................................................................. +............................................................................... No assertions in section, 'embedded xml' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./misc/xmlentitycheck encoded chars -................................................................. +............................................................................... No assertions in section, 'encoded chars' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./manual/onechar -................................................................. +............................................................................... info: 3 @@ -2560,9 +2560,9 @@ FAILED: REQUIRE( false ) MiscTests.cpp:196: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/atomic if -................................................................. +............................................................................... PASSED: REQUIRE( x == 0 ) @@ -2570,9 +2570,9 @@ with expansion: 0 == 0 MiscTests.cpp:206: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/matchers -................................................................. +............................................................................... PASSED: REQUIRE_THAT( testStringForMatching() Contains( "string" ) ) @@ -2598,9 +2598,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "substring" MiscTests.cpp:220: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/Contains -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() Contains( "not there" ) ) @@ -2608,9 +2608,9 @@ with expansion: "this string contains 'abc' as a substring" contains: "not there" MiscTests.cpp:225: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/StartsWith -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() StartsWith( "string" ) ) @@ -2618,9 +2618,9 @@ with expansion: "this string contains 'abc' as a substring" starts with: "string" MiscTests.cpp:230: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/EndsWith -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() EndsWith( "this" ) ) @@ -2628,9 +2628,9 @@ with expansion: "this string contains 'abc' as a substring" ends with: "this" MiscTests.cpp:235: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/matchers/Equals -................................................................. +............................................................................... FAILED: CHECK_THAT( testStringForMatching() Equals( "something else" ) ) @@ -2638,20 +2638,20 @@ with expansion: "this string contains 'abc' as a substring" equals: "something else" MiscTests.cpp:240: ------------------------------------------------------------------ +------------------------------------------------------------------------------- /succeeding/matchers/AllOf -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) ) with expansion: - "this string contains 'abc' as a substring" ( contains: "string" - and contains: "abc" ) + "this string contains 'abc' as a substring" ( contains: "string" and + contains: "abc" ) MiscTests.cpp:248: ------------------------------------------------------------------ +------------------------------------------------------------------------------- /succeeding/matchers/AnyOf -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) ) @@ -2663,24 +2663,24 @@ MiscTests.cpp:252: PASSED: CHECK_THAT( testStringForMatching() AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) ) with expansion: - "this string contains 'abc' as a substring" ( contains: "not there" - or contains: "string" ) + "this string contains 'abc' as a substring" ( contains: "not there" or + contains: "string" ) MiscTests.cpp:253: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/matchers/Equals -................................................................. +............................................................................... PASSED: CHECK_THAT( testStringForMatching() Equals( "this string contains 'abc' as a substring" ) ) with expansion: - "this string contains 'abc' as a substring" equals: "this string - contains 'abc' as a substring" + "this string contains 'abc' as a substring" equals: "this string contains + 'abc' as a substring" MiscTests.cpp:258: ------------------------------------------------------------------ +------------------------------------------------------------------------------- example/factorial -................................................................. +............................................................................... PASSED: REQUIRE( Factorial(0) == 1 ) @@ -2712,16 +2712,16 @@ with expansion: 0x == 3628800 MiscTests.cpp:273: ------------------------------------------------------------------ +------------------------------------------------------------------------------- empty -................................................................. +............................................................................... No assertions in test case, 'empty' ------------------------------------------------------------------ +------------------------------------------------------------------------------- Nice descriptive name -................................................................. +............................................................................... warning: This one ran @@ -2730,25 +2730,25 @@ MiscTests.cpp:282: No assertions in test case, 'Nice descriptive name' ------------------------------------------------------------------ +------------------------------------------------------------------------------- first tag -................................................................. +............................................................................... No assertions in test case, 'first tag' ------------------------------------------------------------------ +------------------------------------------------------------------------------- second tag -................................................................. +............................................................................... No assertions in test case, 'second tag' ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/expected result selftest/expected result/failing tests -................................................................. +............................................................................... PASSED: with message: @@ -2875,11 +2875,11 @@ with message: Tests failed, as expected catch_self_test.hpp:114: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/expected result selftest/expected result/succeeding tests -................................................................. +............................................................................... PASSED: with message: @@ -3109,11 +3109,11 @@ Message from section one Message from section two Some information An error ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/test counts selftest/test counts/succeeding tests -................................................................. +............................................................................... FAILED: CHECK( totals.assertions.passed == 291 ) @@ -3127,11 +3127,11 @@ with expansion: 0 == 0 TestMain.cpp:41: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/main selftest/test counts selftest/test counts/failing tests -................................................................. +............................................................................... PASSED: CHECK( totals.assertions.passed == 1 ) @@ -3145,9 +3145,9 @@ with expansion: 72 == 72 TestMain.cpp:48: ------------------------------------------------------------------ +------------------------------------------------------------------------------- meta/Misc/Sections -................................................................. +............................................................................... PASSED: CHECK( totals.assertions.passed == 2 ) @@ -3161,10 +3161,10 @@ with expansion: 1 == 1 TestMain.cpp:58: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 default -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3194,11 +3194,11 @@ with expansion: true TestMain.cpp:102: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3222,11 +3222,11 @@ with expansion: true TestMain.cpp:112: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/exclude:1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3250,11 +3250,11 @@ with expansion: true TestMain.cpp:120: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3278,11 +3278,11 @@ with expansion: true TestMain.cpp:129: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:1 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3306,11 +3306,11 @@ with expansion: true TestMain.cpp:138: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists --test/exclude:2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3334,11 +3334,11 @@ with expansion: true TestMain.cpp:147: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3368,24 +3368,24 @@ with expansion: true TestMain.cpp:157: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 test lists -t/0 -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "at least 1" ) ) with expansion: - "Error while parsing arguments. Expected at least 1 argument." - contains: "at least 1" + "Error while parsing arguments. Expected at least 1 argument." contains: "at + least 1" TestMain.cpp:162: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/console -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3397,11 +3397,11 @@ with expansion: "console" == "console" TestMain.cpp:171: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/xml -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3413,11 +3413,11 @@ with expansion: "xml" == "xml" TestMain.cpp:177: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter --reporter/junit -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3429,24 +3429,24 @@ with expansion: "junit" == "junit" TestMain.cpp:183: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 reporter -r/error -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "1 argument" ) ) with expansion: - "Error while parsing arguments. Expected 1 argument. Arguments - were: one two" contains: "1 argument" + "Error while parsing arguments. Expected 1 argument. Arguments were: one + two" contains: "1 argument" TestMain.cpp:187: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger -b -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3458,11 +3458,11 @@ with expansion: true == true TestMain.cpp:196: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger --break -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3474,24 +3474,24 @@ with expansion: true TestMain.cpp:202: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 debugger -b -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 arguments" ) ) with expansion: - "Error while parsing arguments. Expected 0 arguments. Arguments - were: unexpected" contains: "0 arguments" + "Error while parsing arguments. Expected 0 arguments. Arguments were: + unexpected" contains: "0 arguments" TestMain.cpp:206: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3503,11 +3503,11 @@ with expansion: 1 == 1 TestMain.cpp:215: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/2 -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3519,50 +3519,50 @@ with expansion: 2 == 2 TestMain.cpp:221: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/0 -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater - than zero. Arguments were: 0" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than + zero. Arguments were: 0" contains: "greater than zero" TestMain.cpp:225: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/non numeric -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "greater than zero" ) ) with expansion: - "Error while parsing arguments. threshold must be a number greater - than zero. Arguments were: oops" contains: "greater than zero" + "Error while parsing arguments. threshold must be a number greater than + zero. Arguments were: oops" contains: "greater than zero" TestMain.cpp:229: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 abort -a/error/two args -................................................................. +............................................................................... PASSED: REQUIRE_THAT( parseIntoConfigAndReturnError( argv, config ) Contains( "0 and 1 argument" ) ) with expansion: - "Error while parsing arguments. Expected between 0 and 1 argument. - Arguments were: 1 2" contains: "0 and 1 argument" + "Error while parsing arguments. Expected between 0 and 1 argument. Arguments + were: 1 2" contains: "0 and 1 argument" TestMain.cpp:233: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 nothrow -nt -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3574,11 +3574,11 @@ with expansion: false == false TestMain.cpp:242: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 nothrow --nothrow -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3590,11 +3590,11 @@ with expansion: false == false TestMain.cpp:248: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams -o filename -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3612,11 +3612,11 @@ with expansion: true TestMain.cpp:258: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams -o %stdout -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3634,11 +3634,11 @@ with expansion: true TestMain.cpp:265: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 streams --out -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3650,11 +3650,11 @@ with expansion: "filename.ext" == "filename.ext" TestMain.cpp:271: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/parser/2 combinations -a -b -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) @@ -3678,9 +3678,9 @@ with expansion: false == false TestMain.cpp:282: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/test filter -................................................................. +............................................................................... PASSED: CHECK( matchAny.shouldInclude( fakeTestCase( "any" ) ) ) @@ -3718,9 +3718,9 @@ with expansion: false == false TestMain.cpp:301: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/test filters -................................................................. +............................................................................... PASSED: CHECK( matchHidden.shouldInclude( fakeTestCase( "./something" ) ) ) @@ -3746,9 +3746,9 @@ with expansion: false == false TestMain.cpp:316: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/filter/prefix wildcard -................................................................. +............................................................................... PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3762,9 +3762,9 @@ with expansion: false == false TestMain.cpp:323: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/filter/wildcard at both ends -................................................................. +............................................................................... PASSED: CHECK( matchBadgers.shouldInclude( fakeTestCase( "big badger" ) ) ) @@ -3790,9 +3790,9 @@ with expansion: false == false TestMain.cpp:331: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/option parsers -................................................................. +............................................................................... PASSED: CHECK_NOTHROW( opt.parseIntoConfig( parser, config ) ) @@ -3816,10 +3816,10 @@ with expansion: true TestMain.cpp:355: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags one tag -................................................................. +............................................................................... PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -3869,10 +3869,10 @@ with expansion: false == false TestMain.cpp:377: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags two tags -................................................................. +............................................................................... PASSED: CHECK( twoTags.getTestCaseInfo().description == "" ) @@ -3934,10 +3934,10 @@ with expansion: true == true TestMain.cpp:393: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags one tag with characters either side -................................................................. +............................................................................... PASSED: CHECK( oneTagWithExtras.getTestCaseInfo().description == "1234" ) @@ -3963,10 +3963,10 @@ with expansion: 1 == 1 TestMain.cpp:402: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags start of a tag, but not closed -................................................................. +............................................................................... PASSED: CHECK( oneTagOpen.getTestCaseInfo().description == "[one" ) @@ -3986,10 +3986,10 @@ with expansion: 0 == 0 TestMain.cpp:411: ------------------------------------------------------------------ +------------------------------------------------------------------------------- selftest/tags hidden -................................................................. +............................................................................... PASSED: CHECK( oneTag.getTestCaseInfo().description == "" ) @@ -4015,9 +4015,9 @@ with expansion: false == false TestMain.cpp:421: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Tricky/std::pair -................................................................. +............................................................................... PASSED: REQUIRE( (std::pair( 1, 2 )) == aNicePair ) @@ -4028,33 +4028,33 @@ with expansion: std::pair( 1, 2 ) TrickyTests.cpp:37: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./inprogress/failing/Tricky/trailing expression -................................................................. +............................................................................... warning: - Uncomment the code in this test to check that it gives a sensible - compiler error + Uncomment the code in this test to check that it gives a sensible compiler + error TrickyTests.cpp:55: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./inprogress/failing/Tricky/compound lhs -................................................................. +............................................................................... warning: - Uncomment the code in this test to check that it gives a sensible - compiler error + Uncomment the code in this test to check that it gives a sensible compiler + error TrickyTests.cpp:71: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Tricky/non streamable type -................................................................. +............................................................................... FAILED: CHECK( &o1 == &o2 ) @@ -4068,9 +4068,9 @@ with expansion: {?} == {?} TrickyTests.cpp:96: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/string literals -................................................................. +............................................................................... FAILED: REQUIRE( std::string( "first" ) == "second" ) @@ -4078,9 +4078,9 @@ with expansion: "first" == "second" TrickyTests.cpp:106: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/side-effects -................................................................. +............................................................................... PASSED: REQUIRE( i++ == 7 ) @@ -4094,9 +4094,9 @@ with expansion: 8 == 8 TrickyTests.cpp:120: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/koenig -................................................................. +............................................................................... PASSED: REQUIRE( 0x == o ) @@ -4104,9 +4104,9 @@ with expansion: 0x == {?} TrickyTests.cpp:186: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/non-const== -................................................................. +............................................................................... PASSED: REQUIRE( t == 1u ) @@ -4114,9 +4114,9 @@ with expansion: {?} == 1 TrickyTests.cpp:212: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/enum/bits -................................................................. +............................................................................... PASSED: REQUIRE( 0x == bit30and31 ) @@ -4124,9 +4124,9 @@ with expansion: 0x == 3221225472 TrickyTests.cpp:224: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/boolean member -................................................................. +............................................................................... PASSED: REQUIRE( obj.prop != __null ) @@ -4134,10 +4134,10 @@ with expansion: 0x != 0 TrickyTests.cpp:239: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to true -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value == true ) @@ -4151,10 +4151,10 @@ with expansion: true == true TrickyTests.cpp:260: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool compare to false -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value == false ) @@ -4168,10 +4168,10 @@ with expansion: false == false TrickyTests.cpp:265: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool negation -................................................................. +............................................................................... PASSED: REQUIRE( !is_true::value ) @@ -4179,10 +4179,10 @@ with expansion: true TrickyTests.cpp:270: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool double negation -................................................................. +............................................................................... PASSED: REQUIRE( !!is_true::value ) @@ -4190,10 +4190,10 @@ with expansion: true TrickyTests.cpp:275: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/unimplemented static bool direct -................................................................. +............................................................................... PASSED: REQUIRE( is_true::value ) @@ -4207,9 +4207,9 @@ with expansion: !false TrickyTests.cpp:281: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/SafeBool -................................................................. +............................................................................... PASSED: CHECK( True ) @@ -4229,12 +4229,12 @@ with expansion: !false TrickyTests.cpp:315: ------------------------------------------------------------------ +------------------------------------------------------------------------------- Scenario: Do that thing with the thing Given: This stuff exists When: I do this Then: it should do this -................................................................. +............................................................................... PASSED: REQUIRE( itDoesThis() ) @@ -4242,16 +4242,16 @@ with expansion: true BDDTests.cpp:29: -================================================================= +=============================================================================== 96 test cases - 45 failed (610 assertions - 102 failed) CatchSelfTest is a CATCH v0.9 b15 (integration) host application. Run with -? for options ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/simple -................................................................. +............................................................................... PASSED: REQUIRE( d == Approx( 1.23 ) ) @@ -4289,9 +4289,9 @@ with expansion: Approx( 1.23 ) != 1.24 ApproxTests.cpp:26: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/epsilon -................................................................. +............................................................................... PASSED: REQUIRE( d != Approx( 1.231 ) ) @@ -4305,9 +4305,9 @@ with expansion: 1.23 == Approx( 1.231 ) ApproxTests.cpp:39: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/float -................................................................. +............................................................................... PASSED: REQUIRE( 1.23f == Approx( 1.23f ) ) @@ -4321,9 +4321,9 @@ with expansion: 0 == Approx( 0 ) ApproxTests.cpp:50: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/int -................................................................. +............................................................................... PASSED: REQUIRE( 1 == Approx( 1 ) ) @@ -4333,9 +4333,9 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ApproxTests.cpp:61: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/mixed -................................................................. +............................................................................... PASSED: REQUIRE( 1.0f == Approx( 1 ) ) @@ -4367,9 +4367,9 @@ with expansion: 1.234 == Approx( 1.234 ) ApproxTests.cpp:79: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Approx/custom -................................................................. +............................................................................... PASSED: REQUIRE( d == approx( 1.23 ) ) @@ -4419,9 +4419,9 @@ with expansion: Approx( 1.23 ) != 1.25 ApproxTests.cpp:101: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/TestClass/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( s == "hello" ) @@ -4429,9 +4429,9 @@ with expansion: "hello" == "hello" ClassTests.cpp:24: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/TestClass/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( s == "world" ) @@ -4439,9 +4439,9 @@ with expansion: "hello" == "world" ClassTests.cpp:28: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/Fixture/succeedingCase -................................................................. +............................................................................... PASSED: REQUIRE( m_a == 1 ) @@ -4449,9 +4449,9 @@ with expansion: 1 == 1 ClassTests.cpp:47: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/Fixture/failingCase -................................................................. +............................................................................... FAILED: REQUIRE( m_a == 2 ) @@ -4459,9 +4459,9 @@ with expansion: 1 == 2 ClassTests.cpp:55: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./succeeding/conditions/equality -................................................................. +............................................................................... PASSED: REQUIRE( data.int_seven == 7 ) @@ -4505,9 +4505,9 @@ with expansion: 1.3 == Approx( 1.3 ) ConditionTests.cpp:63: ------------------------------------------------------------------ +------------------------------------------------------------------------------- ./failing/conditions/equality -................................................................. +............................................................................... FAILED: CHECK( data.int_seven == 6 ) @@ -4521,7 +4521,7 @@ with expansion: 7 == 8 ConditionTests.cpp:72: -================================================================= +=============================================================================== 12 test cases - 3 failed (38 assertions - 4 failed)