diff --git a/README.md b/README.md index 71360025..13e70dde 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](https://raw.github.com/philsquared/Catch/Integration/catch-logo-small.png) -## CATCH v0.9 build 29 (integration branch) +## CATCH v0.9 build 30 (integration branch) An automated test framework for C, C++ and Objective-C. This branch may contain code that is experimental or not yet fully tested. diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index d271e4c7..046d4b9b 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -13,7 +13,7 @@ namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 29, "integration" ); + Version libraryVersion( 0, 9, 30, "integration" ); } #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index cc251b7e..bd8e6d8f 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1,9 +1,11 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b28 (integration) host application. +CatchSelfTest is a CATCH v0.9 b30 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- +ApproxTests.cpp:16 + ./succeeding/Approx/simple ............................................................................... @@ -44,6 +46,8 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- +ApproxTests.cpp:34 + ./succeeding/Approx/epsilon ............................................................................... @@ -60,6 +64,8 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:47 + ./succeeding/Approx/float ............................................................................... @@ -76,6 +82,8 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:58 + ./succeeding/Approx/int ............................................................................... @@ -88,6 +96,8 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- +ApproxTests.cpp:69 + ./succeeding/Approx/mixed ............................................................................... @@ -122,6 +132,8 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:87 + ./succeeding/Approx/custom ............................................................................... @@ -174,6 +186,8 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- +ApproxTests.cpp:108 + Approximate PI ............................................................................... @@ -190,6 +204,8 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- +ClassTests.cpp:34 + ./succeeding/TestClass/succeedingCase ............................................................................... @@ -200,6 +216,8 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- +ClassTests.cpp:35 + ./failing/TestClass/failingCase ............................................................................... @@ -209,6 +227,8 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- +ClassTests.cpp:45 + ./succeeding/Fixture/succeedingCase ............................................................................... @@ -219,6 +239,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ClassTests.cpp:53 + ./failing/Fixture/failingCase ............................................................................... @@ -228,6 +250,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:47 + ./succeeding/conditions/equality ............................................................................... @@ -274,6 +298,8 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:67 + ./failing/conditions/equality ............................................................................... @@ -343,6 +369,8 @@ with expansion: 1.3 == Approx( 1.301 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:89 + ./succeeding/conditions/inequality ............................................................................... @@ -413,6 +441,8 @@ with expansion: 5 != 6 ------------------------------------------------------------------------------- +ConditionTests.cpp:107 + ./failing/conditions/inequality ............................................................................... @@ -442,6 +472,8 @@ with expansion: 5 != 5 ------------------------------------------------------------------------------- +ConditionTests.cpp:120 + ./succeeding/conditions/ordered ............................................................................... @@ -548,6 +580,8 @@ with expansion: "hello" > "a" ------------------------------------------------------------------------------- +ConditionTests.cpp:148 + ./failing/conditions/ordered ............................................................................... @@ -647,6 +681,8 @@ with expansion: "hello" <= "a" ------------------------------------------------------------------------------- +ConditionTests.cpp:179 + ./succeeding/conditions/int literals ............................................................................... @@ -729,6 +765,8 @@ with expansion: 0x > 4 ------------------------------------------------------------------------------- +ConditionTests.cpp:218 + ./succeeding/conditions//long_to_unsigned_x ............................................................................... @@ -757,6 +795,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ConditionTests.cpp:233 + ./succeeding/conditions/const ints to int literal ............................................................................... @@ -785,6 +825,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ConditionTests.cpp:247 + ./succeeding/conditions/negative ints ............................................................................... @@ -825,6 +867,8 @@ with expansion: -2147483648 > 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:270 + ./succeeding/conditions/computed ints ............................................................................... @@ -835,6 +879,8 @@ with expansion: 54 == 54 ------------------------------------------------------------------------------- +ConditionTests.cpp:283 + ./succeeding/conditions/ptr ............................................................................... @@ -887,6 +933,8 @@ with expansion: 0 != 0x ------------------------------------------------------------------------------- +ConditionTests.cpp:316 + ./succeeding/conditions/not ............................................................................... @@ -933,6 +981,8 @@ with expansion: !(1 == 2) ------------------------------------------------------------------------------- +ConditionTests.cpp:333 + ./failing/conditions/not ............................................................................... @@ -971,6 +1021,8 @@ with expansion: !(1 == 1) ------------------------------------------------------------------------------- +ExceptionTests.cpp:33 + ./succeeding/exceptions/explicit ............................................................................... @@ -987,6 +1039,8 @@ PASSED: REQUIRE_THROWS( thisThrows() ) ------------------------------------------------------------------------------- +ExceptionTests.cpp:41 + ./failing/exceptions/explicit ............................................................................... @@ -1005,6 +1059,8 @@ due to unexpected exception with message: expected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:48 + ./failing/exceptions/implicit ............................................................................... @@ -1013,6 +1069,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:54 + ./failing/exceptions/implicit/2 ............................................................................... @@ -1026,6 +1084,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:62 + ./failing/exceptions/implicit/3 section name ............................................................................... @@ -1035,6 +1095,8 @@ due to unexpected exception with message: unexpected exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:69 + ./succeeding/exceptions/implicit ............................................................................... @@ -1042,6 +1104,8 @@ due to unexpected exception with message: No assertions in test case, './succeeding/exceptions/implicit' ------------------------------------------------------------------------------- +ExceptionTests.cpp:106 + ./failing/exceptions/custom ............................................................................... @@ -1050,6 +1114,8 @@ due to unexpected exception with message: custom exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:114 + ./failing/exceptions/custom/nothrow ............................................................................... @@ -1059,6 +1125,8 @@ due to unexpected exception with message: unexpected custom exception ------------------------------------------------------------------------------- +ExceptionTests.cpp:119 + ./failing/exceptions/custom/throw ............................................................................... @@ -1068,6 +1136,8 @@ due to unexpected exception with message: custom exception - not std ------------------------------------------------------------------------------- +ExceptionTests.cpp:125 + ./failing/exceptions/custom/double ............................................................................... @@ -1076,6 +1146,8 @@ due to unexpected exception with message: 3.14 ------------------------------------------------------------------------------- +ExceptionTests.cpp:134 + ./succeeding/exceptions/notimplemented ............................................................................... @@ -1084,6 +1156,8 @@ PASSED: REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) ) ------------------------------------------------------------------------------- +GeneratorTests.cpp:19 + ./succeeding/generators/1 ............................................................................... @@ -1952,6 +2026,8 @@ with expansion: 214 == 214 ------------------------------------------------------------------------------- +GeneratorTests.cpp:32 + ./succeeding/generators/2 ............................................................................... @@ -1968,6 +2044,8 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- +MessageTests.cpp:11 + ./succeeding/message ............................................................................... @@ -1980,6 +2058,8 @@ warning: No assertions in test case, './succeeding/message' ------------------------------------------------------------------------------- +MessageTests.cpp:16 + ./succeeding/succeed ............................................................................... @@ -1989,6 +2069,8 @@ with message: this is a success ------------------------------------------------------------------------------- +MessageTests.cpp:21 + ./failing/message/info/1 ............................................................................... @@ -2001,6 +2083,8 @@ with messages: so should this ------------------------------------------------------------------------------- +MessageTests.cpp:29 + ./mixed/message/info/2 ............................................................................... @@ -2035,6 +2119,8 @@ with message: but not this ------------------------------------------------------------------------------- +MessageTests.cpp:48 + ./failing/message/fail ............................................................................... @@ -2043,6 +2129,8 @@ explicitly with message: This is a failure ------------------------------------------------------------------------------- +MessageTests.cpp:56 + ./failing/message/sections one ............................................................................... @@ -2052,6 +2140,8 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- +MessageTests.cpp:61 + ./failing/message/sections two ............................................................................... @@ -2062,6 +2152,8 @@ explicitly with message: Message from section one ------------------------------------------------------------------------------- +MessageTests.cpp:69 + ./succeeding/message/sections/stdout one ............................................................................... @@ -2071,6 +2163,8 @@ No assertions in section, 'one' Message from section two ------------------------------------------------------------------------------- +MessageTests.cpp:74 + ./succeeding/message/sections/stdout two ............................................................................... @@ -2079,6 +2173,8 @@ Message from section two No assertions in section, 'two' ------------------------------------------------------------------------------- +MessageTests.cpp:80 + ./mixed/message/scoped ............................................................................... @@ -2181,6 +2277,8 @@ with messages: i := 10 ------------------------------------------------------------------------------- +MessageTests.cpp:90 + ./succeeding/nofail ............................................................................... @@ -2192,6 +2290,8 @@ FAILED - but was ok: No assertions in test case, './succeeding/nofail' ------------------------------------------------------------------------------- +MessageTests.cpp:95 + just info ............................................................................... @@ -2199,6 +2299,8 @@ just info No assertions in test case, 'just info' ------------------------------------------------------------------------------- +MessageTests.cpp:99 + just failure ............................................................................... @@ -2207,6 +2309,8 @@ explicitly with message: Previous info should not be seen ------------------------------------------------------------------------------- +MiscTests.cpp:19 + ./succeeding/Misc/Sections s1 ............................................................................... @@ -2224,6 +2328,8 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- +MiscTests.cpp:25 + ./succeeding/Misc/Sections s2 ............................................................................... @@ -2235,6 +2341,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:36 + ./succeeding/Misc/Sections/nested s1 ............................................................................... @@ -2252,6 +2360,8 @@ with expansion: 2 != 1 ------------------------------------------------------------------------------- +MiscTests.cpp:41 + ./succeeding/Misc/Sections/nested s1 s2 @@ -2264,6 +2374,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:55 + ./mixed/Misc/Sections/nested2 s1 s2 @@ -2275,6 +2387,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +MiscTests.cpp:60 + ./mixed/Misc/Sections/nested2 s1 s3 @@ -2287,6 +2401,8 @@ with expansion: 1 != 2 ------------------------------------------------------------------------------- +MiscTests.cpp:64 + ./mixed/Misc/Sections/nested2 s1 s4 @@ -2299,6 +2415,8 @@ with expansion: 1 < 2 ------------------------------------------------------------------------------- +MiscTests.cpp:75 + ./Sections/nested/a/b c d (leaf) @@ -2308,6 +2426,8 @@ with expansion: No assertions in section, 'd (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:79 + ./Sections/nested/a/b c e (leaf) @@ -2317,6 +2437,8 @@ No assertions in section, 'd (leaf)' No assertions in section, 'e (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:84 + ./Sections/nested/a/b f (leaf) ............................................................................... @@ -2325,6 +2447,8 @@ No assertions in section, 'e (leaf)' No assertions in section, 'f (leaf)' ------------------------------------------------------------------------------- +MiscTests.cpp:97 + ./mixed/Misc/Sections/loops s1 ............................................................................... @@ -2335,6 +2459,8 @@ with expansion: 0 > 1 ------------------------------------------------------------------------------- +MiscTests.cpp:104 + ./mixed/Misc/loops ............................................................................... @@ -2399,6 +2525,8 @@ with message: Some information An error ------------------------------------------------------------------------------- +MiscTests.cpp:115 + ./succeeding/Misc/stdout,stderr ............................................................................... @@ -2406,6 +2534,8 @@ An error No assertions in test case, './succeeding/Misc/stdout,stderr' ------------------------------------------------------------------------------- +MiscTests.cpp:127 + ./succeeding/Misc/null strings ............................................................................... @@ -2422,6 +2552,8 @@ with expansion: {null string} == {null string} ------------------------------------------------------------------------------- +MiscTests.cpp:133 + ./failing/info ............................................................................... @@ -2432,6 +2564,8 @@ with messages: i := 7 ------------------------------------------------------------------------------- +MiscTests.cpp:149 + ./succeeding/checkedif ............................................................................... @@ -2448,6 +2582,8 @@ with expansion: true ------------------------------------------------------------------------------- +MiscTests.cpp:154 + ./failing/checkedif ............................................................................... @@ -2462,6 +2598,8 @@ with expansion: false ------------------------------------------------------------------------------- +MiscTests.cpp:167 + ./succeeding/checkedelse ............................................................................... @@ -2478,6 +2616,8 @@ with expansion: true ------------------------------------------------------------------------------- +MiscTests.cpp:172 + ./failing/checkedelse ............................................................................... @@ -2492,6 +2632,8 @@ with expansion: false ------------------------------------------------------------------------------- +MiscTests.cpp:179 + ./misc/xmlentitycheck embedded xml ............................................................................... @@ -2500,6 +2642,8 @@ with expansion: No assertions in section, 'embedded xml' ------------------------------------------------------------------------------- +MiscTests.cpp:183 + ./misc/xmlentitycheck encoded chars ............................................................................... @@ -2508,6 +2652,8 @@ No assertions in section, 'embedded xml' No assertions in section, 'encoded chars' ------------------------------------------------------------------------------- +MiscTests.cpp:189 + ./manual/onechar ............................................................................... @@ -2517,6 +2663,8 @@ with message: 3 ------------------------------------------------------------------------------- +MiscTests.cpp:195 + ./succeeding/atomic if ............................................................................... @@ -2527,6 +2675,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +MiscTests.cpp:210 + ./succeeding/matchers ............................................................................... @@ -2555,6 +2705,8 @@ with expansion: "this string contains 'abc' as a substring" ends with: "substring" ------------------------------------------------------------------------------- +MiscTests.cpp:219 + ./failing/matchers/Contains ............................................................................... @@ -2564,6 +2716,8 @@ with expansion: "this string contains 'abc' as a substring" contains: "not there" ------------------------------------------------------------------------------- +MiscTests.cpp:224 + ./failing/matchers/StartsWith ............................................................................... @@ -2573,6 +2727,8 @@ with expansion: "this string contains 'abc' as a substring" starts with: "string" ------------------------------------------------------------------------------- +MiscTests.cpp:229 + ./failing/matchers/EndsWith ............................................................................... @@ -2582,6 +2738,8 @@ with expansion: "this string contains 'abc' as a substring" ends with: "this" ------------------------------------------------------------------------------- +MiscTests.cpp:234 + ./failing/matchers/Equals ............................................................................... @@ -2591,6 +2749,8 @@ with expansion: "this string contains 'abc' as a substring" equals: "something else" ------------------------------------------------------------------------------- +MiscTests.cpp:242 + ./succeeding/matchers/AllOf ............................................................................... @@ -2602,6 +2762,8 @@ with expansion: contains: "abc" ) ------------------------------------------------------------------------------- +MiscTests.cpp:246 + ./succeeding/matchers/AnyOf ............................................................................... @@ -2620,6 +2782,8 @@ with expansion: contains: "string" ) ------------------------------------------------------------------------------- +MiscTests.cpp:252 + ./succeeding/matchers/Equals ............................................................................... @@ -2631,6 +2795,8 @@ with expansion: 'abc' as a substring" ------------------------------------------------------------------------------- +MiscTests.cpp:263 + example/factorial ............................................................................... @@ -2665,6 +2831,8 @@ with expansion: 0x == 3628800 ------------------------------------------------------------------------------- +MiscTests.cpp:272 + empty ............................................................................... @@ -2672,6 +2840,8 @@ empty No assertions in test case, 'empty' ------------------------------------------------------------------------------- +MiscTests.cpp:276 + Nice descriptive name ............................................................................... @@ -2683,6 +2853,8 @@ warning: No assertions in test case, 'Nice descriptive name' ------------------------------------------------------------------------------- +MiscTests.cpp:280 + first tag ............................................................................... @@ -2690,6 +2862,8 @@ first tag No assertions in test case, 'first tag' ------------------------------------------------------------------------------- +MiscTests.cpp:283 + second tag ............................................................................... @@ -2697,6 +2871,8 @@ second tag No assertions in test case, 'second tag' ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2713,6 +2889,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:303 + vectors can be sized and resized resizing bigger changes size and capacity ............................................................................... @@ -2730,6 +2908,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2746,6 +2926,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:309 + vectors can be sized and resized resizing smaller changes size but not capacity ............................................................................... @@ -2763,6 +2945,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:315 + vectors can be sized and resized resizing smaller changes size but not capacity We can use the 'swap trick' to reset the capacity @@ -2775,6 +2959,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2791,6 +2977,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:309 + vectors can be sized and resized resizing smaller changes size but not capacity ............................................................................... @@ -2808,6 +2996,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2824,6 +3014,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:322 + vectors can be sized and resized reserving bigger changes capacity but not size ............................................................................... @@ -2841,6 +3033,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +MiscTests.cpp:296 + vectors can be sized and resized ............................................................................... @@ -2857,6 +3051,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +MiscTests.cpp:328 + vectors can be sized and resized reserving smaller does not change size or capacity ............................................................................... @@ -2874,6 +3070,8 @@ with expansion: 5 >= 5 ------------------------------------------------------------------------------- +TestMain.cpp:23 + selftest/main selftest/expected result selftest/expected result/failing tests @@ -3010,6 +3208,8 @@ with message: Tests failed, as expected ------------------------------------------------------------------------------- +TestMain.cpp:28 + selftest/main selftest/expected result selftest/expected result/succeeding tests @@ -3254,6 +3454,8 @@ Message from section two Some information An error ------------------------------------------------------------------------------- +TestMain.cpp:39 + selftest/main selftest/test counts selftest/test counts/succeeding tests @@ -3272,6 +3474,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +TestMain.cpp:46 + selftest/main selftest/test counts selftest/test counts/failing tests @@ -3290,6 +3494,8 @@ with expansion: 73 == 73 ------------------------------------------------------------------------------- +TestMain.cpp:54 + meta/Misc/Sections ............................................................................... @@ -3306,6 +3512,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:96 + selftest/parser/2 default ............................................................................... @@ -3339,6 +3547,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:107 + selftest/parser/2 test lists -t/1 @@ -3367,6 +3577,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:115 + selftest/parser/2 test lists -t/exclude:1 @@ -3395,6 +3607,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:124 + selftest/parser/2 test lists --test/1 @@ -3423,6 +3637,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:133 + selftest/parser/2 test lists --test/exclude:1 @@ -3451,6 +3667,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:142 + selftest/parser/2 test lists --test/exclude:2 @@ -3479,6 +3697,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:151 + selftest/parser/2 test lists -t/2 @@ -3513,6 +3733,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:161 + selftest/parser/2 test lists -t/0 @@ -3526,6 +3748,8 @@ with expansion: least 1" ------------------------------------------------------------------------------- +TestMain.cpp:168 + selftest/parser/2 reporter -r/console @@ -3542,6 +3766,8 @@ with expansion: "console" == "console" ------------------------------------------------------------------------------- +TestMain.cpp:174 + selftest/parser/2 reporter -r/xml @@ -3558,6 +3784,8 @@ with expansion: "xml" == "xml" ------------------------------------------------------------------------------- +TestMain.cpp:180 + selftest/parser/2 reporter --reporter/junit @@ -3574,6 +3802,8 @@ with expansion: "junit" == "junit" ------------------------------------------------------------------------------- +TestMain.cpp:186 + selftest/parser/2 reporter -r/error @@ -3587,6 +3817,8 @@ with expansion: two" contains: "1 argument" ------------------------------------------------------------------------------- +TestMain.cpp:193 + selftest/parser/2 debugger -b @@ -3603,6 +3835,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TestMain.cpp:199 + selftest/parser/2 debugger --break @@ -3619,6 +3853,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:205 + selftest/parser/2 debugger -b @@ -3632,6 +3868,8 @@ with expansion: unexpected" contains: "0 arguments" ------------------------------------------------------------------------------- +TestMain.cpp:212 + selftest/parser/2 abort -a @@ -3648,6 +3886,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:218 + selftest/parser/2 abort -a/2 @@ -3664,6 +3904,8 @@ with expansion: 2 == 2 ------------------------------------------------------------------------------- +TestMain.cpp:224 + selftest/parser/2 abort -a/error/0 @@ -3677,6 +3919,8 @@ with expansion: . Arguments were: 0" contains: "greater than zero" ------------------------------------------------------------------------------- +TestMain.cpp:228 + selftest/parser/2 abort -a/error/non numeric @@ -3690,6 +3934,8 @@ with expansion: . Arguments were: oops" contains: "greater than zero" ------------------------------------------------------------------------------- +TestMain.cpp:232 + selftest/parser/2 abort -a/error/two args @@ -3703,6 +3949,8 @@ with expansion: were: 1 2" contains: "0 and 1 argument" ------------------------------------------------------------------------------- +TestMain.cpp:239 + selftest/parser/2 nothrow -nt @@ -3719,6 +3967,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:245 + selftest/parser/2 nothrow --nothrow @@ -3735,6 +3985,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:254 + selftest/parser/2 streams -o filename @@ -3757,6 +4009,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:261 + selftest/parser/2 streams -o %stdout @@ -3779,6 +4033,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:268 + selftest/parser/2 streams --out @@ -3795,6 +4051,8 @@ with expansion: "filename.ext" == "filename.ext" ------------------------------------------------------------------------------- +TestMain.cpp:277 + selftest/parser/2 combinations -a -b @@ -3823,6 +4081,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:288 + selftest/test filter ............................................................................... @@ -3863,6 +4123,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:305 + selftest/test filters ............................................................................... @@ -3891,6 +4153,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:320 + selftest/filter/prefix wildcard ............................................................................... @@ -3907,6 +4171,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:326 + selftest/filter/wildcard at both ends ............................................................................... @@ -3935,6 +4201,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:341 + selftest/option parsers ............................................................................... @@ -3961,6 +4229,8 @@ with expansion: true ------------------------------------------------------------------------------- +TestMain.cpp:367 + selftest/tags one tag ............................................................................... @@ -4014,6 +4284,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:381 + selftest/tags two tags ............................................................................... @@ -4085,6 +4357,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TestMain.cpp:398 + selftest/tags one tag with characters either side ............................................................................... @@ -4114,6 +4388,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +TestMain.cpp:407 + selftest/tags start of a tag, but not closed ............................................................................... @@ -4137,6 +4413,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +TestMain.cpp:416 + selftest/tags hidden ............................................................................... @@ -4166,6 +4444,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TestMain.cpp:434 + Long strings can be wrapped plain string No wrapping @@ -4188,6 +4468,8 @@ with expansion: "one two three four" ------------------------------------------------------------------------------- +TestMain.cpp:438 + Long strings can be wrapped plain string Wrapped once @@ -4244,6 +4526,8 @@ with expansion: three four" ------------------------------------------------------------------------------- +TestMain.cpp:445 + Long strings can be wrapped plain string Wrapped twice @@ -4274,6 +4558,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:449 + Long strings can be wrapped plain string Wrapped three times @@ -4308,6 +4594,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:453 + Long strings can be wrapped plain string Short wrap @@ -4380,6 +4668,8 @@ with expansion: ur" ------------------------------------------------------------------------------- +TestMain.cpp:461 + Long strings can be wrapped plain string As container @@ -4416,6 +4706,8 @@ with expansion: "four" == "four" ------------------------------------------------------------------------------- +TestMain.cpp:477 + Long strings can be wrapped With newlines No wrapping @@ -4452,6 +4744,8 @@ with expansion: three four" ------------------------------------------------------------------------------- +TestMain.cpp:482 + Long strings can be wrapped With newlines Trailing newline @@ -4484,6 +4778,8 @@ with expansion: " ------------------------------------------------------------------------------- +TestMain.cpp:487 + Long strings can be wrapped With newlines Wrapped once @@ -4526,6 +4822,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TestMain.cpp:492 + Long strings can be wrapped With newlines Wrapped twice @@ -4546,6 +4844,8 @@ with expansion: four" ------------------------------------------------------------------------------- +TrickyTests.cpp:32 + ./succeeding/Tricky/std::pair ............................................................................... @@ -4556,6 +4856,8 @@ with expansion: std::pair( 1, 2 ) == std::pair( 1, 2 ) ------------------------------------------------------------------------------- +TrickyTests.cpp:46 + ./inprogress/failing/Tricky/trailing expression ............................................................................... @@ -4568,6 +4870,8 @@ warning: No assertions in test case, './inprogress/failing/Tricky/trailing expression' ------------------------------------------------------------------------------- +TrickyTests.cpp:62 + ./inprogress/failing/Tricky/compound lhs ............................................................................... @@ -4580,6 +4884,8 @@ warning: No assertions in test case, './inprogress/failing/Tricky/compound lhs' ------------------------------------------------------------------------------- +TrickyTests.cpp:88 + ./failing/Tricky/non streamable type ............................................................................... @@ -4594,6 +4900,8 @@ with expansion: {?} == {?} ------------------------------------------------------------------------------- +TrickyTests.cpp:104 + ./failing/string literals ............................................................................... @@ -4603,6 +4911,8 @@ with expansion: "first" == "second" ------------------------------------------------------------------------------- +TrickyTests.cpp:115 + ./succeeding/side-effects ............................................................................... @@ -4619,6 +4929,8 @@ with expansion: 8 == 8 ------------------------------------------------------------------------------- +TrickyTests.cpp:183 + ./succeeding/koenig ............................................................................... @@ -4629,6 +4941,8 @@ with expansion: 0x == {?} ------------------------------------------------------------------------------- +TrickyTests.cpp:209 + ./succeeding/non-const== ............................................................................... @@ -4639,6 +4953,8 @@ with expansion: {?} == 1 ------------------------------------------------------------------------------- +TrickyTests.cpp:222 + ./succeeding/enum/bits ............................................................................... @@ -4649,6 +4965,8 @@ with expansion: 0x == 3221225472 ------------------------------------------------------------------------------- +TrickyTests.cpp:236 + ./succeeding/boolean member ............................................................................... @@ -4659,6 +4977,8 @@ with expansion: 0x != 0 ------------------------------------------------------------------------------- +TrickyTests.cpp:257 + ./succeeding/unimplemented static bool compare to true ............................................................................... @@ -4676,6 +4996,8 @@ with expansion: true == true ------------------------------------------------------------------------------- +TrickyTests.cpp:262 + ./succeeding/unimplemented static bool compare to false ............................................................................... @@ -4693,6 +5015,8 @@ with expansion: false == false ------------------------------------------------------------------------------- +TrickyTests.cpp:268 + ./succeeding/unimplemented static bool negation ............................................................................... @@ -4704,6 +5028,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:273 + ./succeeding/unimplemented static bool double negation ............................................................................... @@ -4715,6 +5041,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:278 + ./succeeding/unimplemented static bool direct ............................................................................... @@ -4732,6 +5060,8 @@ with expansion: !false ------------------------------------------------------------------------------- +TrickyTests.cpp:308 + ./succeeding/SafeBool ............................................................................... @@ -4754,6 +5084,8 @@ with expansion: !false ------------------------------------------------------------------------------- +TrickyTests.cpp:318 + Assertions then sections ............................................................................... @@ -4764,6 +5096,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:325 + Assertions then sections A section ............................................................................... @@ -4775,6 +5109,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:329 + Assertions then sections A section Another section @@ -4787,6 +5123,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:318 + Assertions then sections ............................................................................... @@ -4797,6 +5135,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:325 + Assertions then sections A section ............................................................................... @@ -4808,6 +5148,8 @@ with expansion: true ------------------------------------------------------------------------------- +TrickyTests.cpp:333 + Assertions then sections A section Another other section @@ -4820,6 +5162,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:19 + Scenario: Do that thing with the thing Given: This stuff exists When: I do this @@ -4833,6 +5177,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:22 + Scenario: Do that thing with the thing Given: This stuff exists When: I do this @@ -4847,6 +5193,8 @@ with expansion: true ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4858,6 +5206,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4877,6 +5227,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:42 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4898,6 +5250,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4909,6 +5263,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4928,6 +5284,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4939,6 +5297,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:36 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: it is made larger @@ -4958,6 +5318,8 @@ with expansion: 10 >= 10 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4969,6 +5331,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:30 + Scenario: Vector resizing affects size and capacity Given: an empty vector ............................................................................... @@ -4980,6 +5344,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:52 + Scenario: Vector resizing affects size and capacity Given: an empty vector When: we reserve more space @@ -4999,6 +5365,8 @@ with expansion: 0 == 0 ------------------------------------------------------------------------------- +BDDTests.cpp:63 + Scenario: This is a really long scenario name to see how the list command deals with wrapping ............................................................................... @@ -5006,6 +5374,8 @@ Scenario: This is a really long scenario name to see how the list command deals No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:12 + Anonymous test case 1 ............................................................................... @@ -5015,6 +5385,8 @@ with message: anonymous test case ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:17 + Test case with one argument ............................................................................... @@ -5024,6 +5396,8 @@ with message: no assertions ------------------------------------------------------------------------------- +VariadicMacrosTests.cpp:24 + Variadic macros Section with one argument ............................................................................... @@ -5038,10 +5412,12 @@ with message: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CatchSelfTest is a CATCH v0.9 b28 (integration) host application. +CatchSelfTest is a CATCH v0.9 b30 (integration) host application. Run with -? for options ------------------------------------------------------------------------------- +ApproxTests.cpp:16 + ./succeeding/Approx/simple ............................................................................... @@ -5082,6 +5458,8 @@ with expansion: Approx( 1.23 ) != 1.24 ------------------------------------------------------------------------------- +ApproxTests.cpp:34 + ./succeeding/Approx/epsilon ............................................................................... @@ -5098,6 +5476,8 @@ with expansion: 1.23 == Approx( 1.231 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:47 + ./succeeding/Approx/float ............................................................................... @@ -5114,6 +5494,8 @@ with expansion: 0 == Approx( 0 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:58 + ./succeeding/Approx/int ............................................................................... @@ -5126,6 +5508,8 @@ PASSED: REQUIRE( 0 == Approx( 0 ) ) ------------------------------------------------------------------------------- +ApproxTests.cpp:69 + ./succeeding/Approx/mixed ............................................................................... @@ -5160,6 +5544,8 @@ with expansion: 1.234 == Approx( 1.234 ) ------------------------------------------------------------------------------- +ApproxTests.cpp:87 + ./succeeding/Approx/custom ............................................................................... @@ -5212,6 +5598,8 @@ with expansion: Approx( 1.23 ) != 1.25 ------------------------------------------------------------------------------- +ApproxTests.cpp:108 + Approximate PI ............................................................................... @@ -5228,6 +5616,8 @@ with expansion: 3.142857142857143 != Approx( 3.141 ) ------------------------------------------------------------------------------- +ClassTests.cpp:34 + ./succeeding/TestClass/succeedingCase ............................................................................... @@ -5238,6 +5628,8 @@ with expansion: "hello" == "hello" ------------------------------------------------------------------------------- +ClassTests.cpp:35 + ./failing/TestClass/failingCase ............................................................................... @@ -5247,6 +5639,8 @@ with expansion: "hello" == "world" ------------------------------------------------------------------------------- +ClassTests.cpp:45 + ./succeeding/Fixture/succeedingCase ............................................................................... @@ -5257,6 +5651,8 @@ with expansion: 1 == 1 ------------------------------------------------------------------------------- +ClassTests.cpp:53 + ./failing/Fixture/failingCase ............................................................................... @@ -5266,6 +5662,8 @@ with expansion: 1 == 2 ------------------------------------------------------------------------------- +ConditionTests.cpp:47 + ./succeeding/conditions/equality ............................................................................... @@ -5312,6 +5710,8 @@ with expansion: 1.3 == Approx( 1.3 ) ------------------------------------------------------------------------------- +ConditionTests.cpp:67 + ./failing/conditions/equality ............................................................................... diff --git a/single_include/catch.hpp b/single_include/catch.hpp index c78dc5d2..240d77d1 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v0.9 build 29 (integration branch) - * Generated: 2013-03-29 13:43:27.058903 + * CATCH v0.9 build 30 (integration branch) + * Generated: 2013-04-01 11:26:11.785709 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -154,7 +154,7 @@ namespace Catch { inline std::ostream& operator << ( std::ostream& os, const SourceLineInfo& info ) { #ifndef __GNUG__ - os << info.file << "(" << info.line << "):"; + os << info.file << "(" << info.line << ")"; #else os << info.file << ":" << info.line; #endif @@ -4193,6 +4193,44 @@ namespace Catch { } // end namespace Catch +// #included from: catch_console_colour.hpp +#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED + +namespace Catch { + + struct IConsoleColourCodes : NonCopyable { + enum Colours { + None, + + FileName, + ResultError, + ResultSuccess, + + Error, + Success, + + OriginalExpression, + ReconstructedExpression, + + SecondaryText, + Headers + }; + + virtual void set( Colours colour ) = 0; + }; + + class TextColour : public IConsoleColourCodes { + public: + TextColour( Colours colour = None ); + void set( Colours colour ); + ~TextColour(); + + private: + IConsoleColourCodes* m_impl; + }; + +} // end namespace Catch + #include #include @@ -4245,17 +4283,31 @@ namespace Catch { tagsWrapper.setRight( maxTagLen ).wrap( it->getTestCaseInfo().tagsAsString ); for( std::size_t i = 0; i < std::max( nameWrapper.size(), tagsWrapper.size() ); ++i ) { + TextColour::Colours colour = TextColour::None; + if( it->getTestCaseInfo().isHidden ) + colour = TextColour::SecondaryText; std::string nameCol; - if( i < nameWrapper.size() ) + if( i < nameWrapper.size() ) { nameCol = nameWrapper[i]; - else + } + else { nameCol = " ..."; - std::cout << nameCol; + colour = TextColour::SecondaryText; + } + + { + TextColour colourGuard( colour ); + std::cout << nameCol; + } if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) { - if( i == 0 ) - std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " " << tagsWrapper[i]; - else - std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " " << tagsWrapper[i]; + if( i == 0 ) { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " "; + } + else { + std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " "; + } + std::cout << tagsWrapper[i]; } std::cout << "\n"; } @@ -4306,10 +4358,14 @@ namespace Catch { wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); std::cout << wrapper; + std::size_t dots = 2; if( maxTagLen > wrapper.last().size() ) - std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); - std::cout << ".. " - << countIt->second + dots += maxTagLen - wrapper.last().size(); + { + TextColour colourGuard( TextColour::SecondaryText ); + std::cout << std::string( dots, '.' ); + } + std::cout << countIt->second << "\n"; } std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; @@ -5514,41 +5570,6 @@ namespace Catch { // #included from: catch_console_colour_impl.hpp #define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED -// #included from: catch_console_colour.hpp -#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED - -namespace Catch { - - struct IConsoleColourCodes : NonCopyable { - enum Colours { - None, - - FileName, - ResultError, - ResultSuccess, - - Error, - Success, - - OriginalExpression, - ReconstructedExpression - }; - - virtual void set( Colours colour ) = 0; - }; - - class TextColour : public IConsoleColourCodes { - public: - TextColour( Colours colour = None ); - void set( Colours colour ); - ~TextColour(); - - private: - IConsoleColourCodes* m_impl; - }; - -} // end namespace Catch - #if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #include @@ -5557,21 +5578,25 @@ namespace { using namespace Catch; WORD mapConsoleColour( IConsoleColourCodes::Colours colour ) { + enum Win32Colours { + Grey = FOREGROUND_INTENSITY, + BrightRed = FOREGROUND_RED | FOREGROUND_INTENSITY, + BrightGreen = FOREGROUND_GREEN | FOREGROUND_INTENSITY, + BrightWhite = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, + DarkGreen = FOREGROUND_GREEN, + Cyan = FOREGROUND_BLUE | FOREGROUND_GREEN, + Yellow = FOREGROUND_RED | FOREGROUND_GREEN + }; switch( colour ) { - case IConsoleColourCodes::FileName: - return FOREGROUND_INTENSITY; // greyed out - case IConsoleColourCodes::ResultError: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::ResultSuccess: - return FOREGROUND_GREEN | FOREGROUND_INTENSITY; // bright green - case IConsoleColourCodes::Error: - return FOREGROUND_RED | FOREGROUND_INTENSITY; // bright red - case IConsoleColourCodes::Success: - return FOREGROUND_GREEN; // dark green - case IConsoleColourCodes::OriginalExpression: - return FOREGROUND_BLUE | FOREGROUND_GREEN; // turquoise - case IConsoleColourCodes::ReconstructedExpression: - return FOREGROUND_RED | FOREGROUND_GREEN; // greeny-yellow + case IConsoleColourCodes::FileName: return Grey; + case IConsoleColourCodes::ResultError: return BrightRed; + case IConsoleColourCodes::ResultSuccess: return BrightGreen; + case IConsoleColourCodes::Error: return BrightRed; + case IConsoleColourCodes::Success: return DarkGreen; + case IConsoleColourCodes::OriginalExpression: return Cyan; + case IConsoleColourCodes::ReconstructedExpression: return Yellow; + case IConsoleColourCodes::SecondaryText: return Grey; + case IConsoleColourCodes::Headers: return 0; default: return 0; } } @@ -5620,39 +5645,39 @@ namespace { // Implementation contributed by Adam Strzelecki (http://github.com/nanoant) // https://github.com/philsquared/Catch/pull/131 + const char* WhiteOrNormal = "[0m"; + const char* BrightRed = "[1;31m"; + const char* BrightGreen = "[1;32m"; +// const char* BrightWhite = "[1;37m"; + const char* Green = "[0;32m"; + const char* Cyan = "[0;36m"; + const char* Yellow = "[0;33m"; + const char* LightGrey = "[0;37m"; +// const char* DarkGrey = "[1;30m"; + struct AnsiConsoleColourCodes : IConsoleColourCodes { ~AnsiConsoleColourCodes() { set( None ); } - void set( Colours colour ) { - const char colourEscape = '\033'; + const char* escapeCodeForColour( Colours colour ) { switch( colour ) { - case FileName: - std::cout << colourEscape << "[0m"; // white/ normal - break; - case ResultError: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case ResultSuccess: - std::cout << colourEscape << "[1;32m"; // bold green - break; - case Error: - std::cout << colourEscape << "[1;31m"; // bold red - break; - case Success: - std::cout << colourEscape << "[0;32m"; // green - break; - case OriginalExpression: - std::cout << colourEscape << "[0;36m"; // cyan - break; - case ReconstructedExpression: - std::cout << colourEscape << "[0;33m"; // yellow - break; - case None: - std::cout << colourEscape << "[0m"; // reset - } + case FileName: return WhiteOrNormal; + case ResultError: return BrightRed; + case ResultSuccess: return BrightGreen; + case Error: return BrightRed; + case Success: return Green; + case OriginalExpression: return Cyan; + case ReconstructedExpression: return Yellow; + case SecondaryText: return LightGrey; + case Headers: return WhiteOrNormal; + case None: return WhiteOrNormal; + } + } + + void set( Colours colour ) { + std::cout << '\033' << escapeCodeForColour( colour ); } }; @@ -6052,7 +6077,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 0, 9, 29, "integration" ); + Version libraryVersion( 0, 9, 30, "integration" ); } // #included from: catch_line_wrap.hpp @@ -6064,7 +6089,7 @@ namespace Catch { : right( CATCH_CONFIG_CONSOLE_WIDTH-1 ), nextTab( 0 ), tab( 0 ), - wrappableChars( " [({.," ), + wrappableChars( " [({.,/|\\" ), recursionCount( 0 ) {} @@ -7411,6 +7436,7 @@ namespace Catch { } void lazyPrintRunInfo() { stream << "\n" << getTildes() << "\n"; + TextColour colour( TextColour::SecondaryText ); stream << testRunInfo->name << " is a CATCH v" << libraryVersion.majorVersion << "." << libraryVersion.minorVersion << " b" @@ -7428,15 +7454,13 @@ namespace Catch { unusedGroupInfo.reset(); } } - void lazyPrintTestCaseInfo() { - if( !currentSectionInfo ) { - printClosedHeader( unusedTestCaseInfo->name ); - stream << std::endl; - } - } void printTestCaseAndSectionHeader() { - printOpenHeader( unusedTestCaseInfo->name ); + printOpenHeader( unusedTestCaseInfo->name, + currentSectionInfo + ? currentSectionInfo->lineInfo + : unusedTestCaseInfo->lineInfo ); if( currentSectionInfo ) { + TextColour colourGuard( TextColour::Headers ); std::vector sections; for( ThreadedSectionInfo* section = currentSectionInfo.get(); section; @@ -7457,9 +7481,16 @@ namespace Catch { printOpenHeader( _name ); stream << getDots() << "\n"; } - void printOpenHeader( std::string const& _name ) { - stream << getDashes() << "\n" - << _name << "\n"; + void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) { + stream << getDashes() << "\n"; + if( !_lineInfo.empty() ){ + TextColour colourGuard( TextColour::FileName ); + stream << _lineInfo << "\n\n"; + } + { + TextColour colourGuard( TextColour::Headers ); + stream << _name << "\n"; + } } void printTotals( const Totals& totals ) {