From 5a60ce211746785f017eda8b59d13cdc2991a920 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 16 Jan 2013 09:30:41 +0000 Subject: [PATCH] console reporter: got rid of spurious blank lines --- include/reporters/catch_reporter_console.hpp | 10 +- .../SelfTest/Baselines/approvedResults.txt | 312 +++++------------- 2 files changed, 90 insertions(+), 232 deletions(-) diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp index 1c9d927d..48b843c2 100644 --- a/include/reporters/catch_reporter_console.hpp +++ b/include/reporters/catch_reporter_console.hpp @@ -213,18 +213,14 @@ namespace Catch { void lazyPrint() { - bool needsNewline = unusedTestCaseInfo || currentSectionInfo; - if( testRunInfo ) lazyPrintRunInfo(); if( unusedGroupInfo ) lazyPrintGroupInfo(); if( unusedTestCaseInfo ) lazyPrintTestCaseInfo(); - if( currentSectionInfo) + if( unusedSectionInfo) lazyPrintSectionInfo(); - if( needsNewline ) - stream << "\n"; m_atLeastOneTestCasePrinted = true; } @@ -250,7 +246,7 @@ namespace Catch { if( !currentSectionInfo ) { stream << getDashes() << "\n" << "Test case" << ": '" << unusedTestCaseInfo->name << "'\n"; - stream << getDashes() << std::endl; + stream << getDashes() << "\n" << std::endl; unusedTestCaseInfo.reset(); } } @@ -286,7 +282,7 @@ namespace Catch { stream << inset; stream << (*it)->name << "\n"; } - stream << getDashes() << std::endl; + stream << getDashes() << "\n" << std::endl; unusedSectionInfo.reset(); } } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index fa259473..ec744ad7 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -1908,7 +1908,6 @@ MiscTests.cpp:25: passed with expansion: 1 != 2 - MiscTests.cpp:26: REQUIRE( b != a ) passed with expansion: @@ -1936,7 +1935,6 @@ MiscTests.cpp:42: passed with expansion: 1 != 2 - MiscTests.cpp:43: REQUIRE( b != a ) passed with expansion: @@ -2408,122 +2406,98 @@ catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected +catch_self_test.hpp:114: +passed with message: + Tests failed, as expected catch_self_test.hpp:114: passed with message: Tests failed, as expected - catch_self_test.hpp:114: passed with message: Tests failed, as expected - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - -catch_self_test.hpp:114: -passed with message: - Tests failed, as expected - - catch_self_test.hpp:114: passed with message: Tests failed, as expected @@ -2539,221 +2513,178 @@ catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected Message from section one Message from section two +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected Some information An error +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected +catch_self_test.hpp:103: +passed with message: + Tests passed, as expected catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - catch_self_test.hpp:103: passed with message: Tests passed, as expected - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - -catch_self_test.hpp:103: -passed with message: - Tests passed, as expected - - catch_self_test.hpp:103: passed with message: Tests passed, as expected @@ -2774,7 +2705,6 @@ TestMain.cpp:40: failed with expansion: 293 == 291 - TestMain.cpp:41: CHECK( totals.assertions.failed == 0 ) passed with expansion: @@ -2792,7 +2722,6 @@ TestMain.cpp:47: passed with expansion: 1 == 1 - TestMain.cpp:48: CHECK( totals.assertions.failed == 72 ) passed with expansion: @@ -2822,25 +2751,21 @@ TestMain.cpp:97: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:99: CHECK( config.shouldDebugBreak == false ) passed with expansion: false == false - TestMain.cpp:100: CHECK( config.cutoff == -1 ) passed with expansion: -1 == -1 - TestMain.cpp:101: CHECK( config.allowThrows == true ) passed with expansion: true == true - TestMain.cpp:102: CHECK( config.reporter.empty() ) passed with expansion: @@ -2857,19 +2782,16 @@ TestMain.cpp:108: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:110: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:111: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:112: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: @@ -2886,19 +2808,16 @@ TestMain.cpp:116: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:118: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:119: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:120: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -2915,19 +2834,16 @@ TestMain.cpp:125: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:127: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:128: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:129: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: @@ -2944,19 +2860,16 @@ TestMain.cpp:134: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:136: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:137: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:138: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -2973,19 +2886,16 @@ TestMain.cpp:143: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:145: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:146: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) == false ) passed with expansion: false == false - TestMain.cpp:147: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "alwaysIncluded" ) ) ) passed with expansion: @@ -3002,25 +2912,21 @@ TestMain.cpp:152: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:154: REQUIRE( config.filters.size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:155: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "notIncluded" ) ) == false ) passed with expansion: false == false - TestMain.cpp:156: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test1" ) ) ) passed with expansion: true - TestMain.cpp:157: REQUIRE( config.filters[0].shouldInclude( fakeTestCase( "test2" ) ) ) passed with expansion: @@ -3050,7 +2956,6 @@ TestMain.cpp:169: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:171: REQUIRE( config.reporter == "console" ) passed with expansion: @@ -3067,7 +2972,6 @@ TestMain.cpp:175: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:177: REQUIRE( config.reporter == "xml" ) passed with expansion: @@ -3084,7 +2988,6 @@ TestMain.cpp:181: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:183: REQUIRE( config.reporter == "junit" ) passed with expansion: @@ -3114,7 +3017,6 @@ TestMain.cpp:194: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:196: REQUIRE( config.shouldDebugBreak == true ) passed with expansion: @@ -3131,7 +3033,6 @@ TestMain.cpp:200: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:202: REQUIRE( config.shouldDebugBreak ) passed with expansion: @@ -3161,7 +3062,6 @@ TestMain.cpp:213: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:215: REQUIRE( config.cutoff == 1 ) passed with expansion: @@ -3178,7 +3078,6 @@ TestMain.cpp:219: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:221: REQUIRE( config.cutoff == 2 ) passed with expansion: @@ -3234,7 +3133,6 @@ TestMain.cpp:240: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:242: REQUIRE( config.allowThrows == false ) passed with expansion: @@ -3251,7 +3149,6 @@ TestMain.cpp:246: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:248: REQUIRE( config.allowThrows == false ) passed with expansion: @@ -3268,13 +3165,11 @@ TestMain.cpp:255: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:257: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: "filename.ext" == "filename.ext" - TestMain.cpp:258: REQUIRE( config.stream.empty() ) passed with expansion: @@ -3291,13 +3186,11 @@ TestMain.cpp:262: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:264: REQUIRE( config.stream == "stdout" ) passed with expansion: "stdout" == "stdout" - TestMain.cpp:265: REQUIRE( config.outputFilename.empty() ) passed with expansion: @@ -3314,7 +3207,6 @@ TestMain.cpp:269: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:271: REQUIRE( config.outputFilename == "filename.ext" ) passed with expansion: @@ -3331,19 +3223,16 @@ TestMain.cpp:278: CHECK_NOTHROW( parseIntoConfig( argv, config ) ) passed - TestMain.cpp:280: CHECK( config.cutoff == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:281: CHECK( config.shouldDebugBreak ) passed with expansion: true - TestMain.cpp:282: CHECK( config.allowThrows == false ) passed with expansion: @@ -3479,43 +3368,36 @@ TestMain.cpp:369: passed with expansion: "" == "" - TestMain.cpp:370: CHECK( oneTag.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:371: CHECK( oneTag.getTags().size() == 1 ) passed with expansion: 1 == 1 - TestMain.cpp:373: CHECK( oneTag.matchesTags( p1 ) == true ) passed with expansion: true == true - TestMain.cpp:374: CHECK( oneTag.matchesTags( p2 ) == true ) passed with expansion: true == true - TestMain.cpp:375: CHECK( oneTag.matchesTags( p3 ) == false ) passed with expansion: false == false - TestMain.cpp:376: CHECK( oneTag.matchesTags( p4 ) == false ) passed with expansion: false == false - TestMain.cpp:377: CHECK( oneTag.matchesTags( p5 ) == false ) passed with expansion: @@ -3532,55 +3414,46 @@ TestMain.cpp:383: passed with expansion: "" == "" - TestMain.cpp:384: CHECK( twoTags.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:385: CHECK( twoTags.hasTag( "two" ) ) passed with expansion: true - TestMain.cpp:386: CHECK( twoTags.hasTag( "three" ) == false ) passed with expansion: false == false - TestMain.cpp:387: CHECK( twoTags.getTags().size() == 2 ) passed with expansion: 2 == 2 - TestMain.cpp:389: CHECK( twoTags.matchesTags( p1 ) == true ) passed with expansion: true == true - TestMain.cpp:390: CHECK( twoTags.matchesTags( p2 ) == true ) passed with expansion: true == true - TestMain.cpp:391: CHECK( twoTags.matchesTags( p3 ) == true ) passed with expansion: true == true - TestMain.cpp:392: CHECK( twoTags.matchesTags( p4 ) == true ) passed with expansion: true == true - TestMain.cpp:393: CHECK( twoTags.matchesTags( p5 ) == true ) passed with expansion: @@ -3597,19 +3470,16 @@ TestMain.cpp:399: passed with expansion: "1234" == "1234" - TestMain.cpp:400: CHECK( oneTagWithExtras.hasTag( "one" ) ) passed with expansion: true - TestMain.cpp:401: CHECK( oneTagWithExtras.hasTag( "two" ) == false ) passed with expansion: false == false - TestMain.cpp:402: CHECK( oneTagWithExtras.getTags().size() == 1 ) passed with expansion: @@ -3626,13 +3496,11 @@ TestMain.cpp:409: passed with expansion: "[one" == "[one" - TestMain.cpp:410: CHECK( oneTagOpen.hasTag( "one" ) == false ) passed with expansion: false == false - TestMain.cpp:411: CHECK( oneTagOpen.getTags().size() == 0 ) passed with expansion: @@ -3649,19 +3517,16 @@ TestMain.cpp:417: passed with expansion: "" == "" - TestMain.cpp:418: CHECK( oneTag.hasTag( "hide" ) ) passed with expansion: true - TestMain.cpp:419: CHECK( oneTag.isHidden() ) passed with expansion: true - TestMain.cpp:421: CHECK( oneTag.matchesTags( "~[hide]" ) == false ) passed with expansion: @@ -3787,7 +3652,6 @@ TrickyTests.cpp:259: passed with expansion: true == true - TrickyTests.cpp:260: REQUIRE( true == is_true::value ) passed with expansion: @@ -3804,7 +3668,6 @@ TrickyTests.cpp:264: passed with expansion: false == false - TrickyTests.cpp:265: REQUIRE( false == is_true::value ) passed with expansion: @@ -3843,7 +3706,6 @@ TrickyTests.cpp:280: passed with expansion: true - TrickyTests.cpp:281: REQUIRE_FALSE( !is_true::value ) passed with expansion: