diff options
| author | Phil Nash | 2013-03-29 11:42:10 +0000 |
|---|---|---|
| committer | Phil Nash | 2013-03-29 11:42:10 +0000 |
| commit | e324d2829d632febf346d1df698da5557c99cf6c (patch) | |
| tree | 636ca2900c8aa1d82d53c06676b4921ee4c68e7f | |
| parent | d0df295c25e1967b9bf94cf234a47a80c47b0369 (diff) | |
| download | catch3-e324d2829d632febf346d1df698da5557c99cf6c.tar.gz | |
Added -l tags
- which lists available tags.
- also improved formatting of -l for tests
| -rw-r--r-- | include/internal/catch_commandline.hpp | 18 | ||||
| -rw-r--r-- | include/internal/catch_config.hpp | 5 | ||||
| -rw-r--r-- | include/internal/catch_line_wrap.h | 1 | ||||
| -rw-r--r-- | include/internal/catch_line_wrap.hpp | 2 | ||||
| -rw-r--r-- | include/internal/catch_list.hpp | 70 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/approvedResults.txt | 756 | ||||
| -rw-r--r-- | projects/XCode4/CatchSelfTest/CatchSelfTest/BDDTests.cpp | 5 |
7 files changed, 710 insertions, 147 deletions
diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp index 7558e257..4c32d7f3 100644 --- a/include/internal/catch_commandline.hpp +++ b/include/internal/catch_commandline.hpp @@ -322,7 +322,8 @@ namespace Catch { m_optionNames.push_back( "--list" ); } virtual std::string argsSynopsis() const { - return "[all | tests | reporters [xml]]"; +// return "[all | tests | reporters | tags [xml]]"; + return "[all | tests | reporters | tags]"; } virtual std::string optionSummary() const { return "Lists available tests or reporters"; @@ -331,29 +332,32 @@ namespace Catch { virtual std::string optionDescription() const { return "With no arguments this option will list all registered tests - one per line.\n" - "Supplying the xml argument formats the list as an xml document (which may be useful for " - "consumption by other tools).\n" +// "Supplying the xml argument formats the list as an xml document (which may be useful for " +// "consumption by other tools).\n" "Supplying the tests or reporters lists tests or reporters respectively - with descriptions.\n" "\n" "Examples:\n" "\n" " -l\n" " -l tests\n" + " -l tags\n" " -l reporters xml\n" - " -l xml"; + ;//" -l xml"; } virtual void parseIntoConfig( const Command& cmd, ConfigData& config ) { - config.listSpec = List::TestNames; + config.listSpec = List::Tests; if( cmd.argsCount() >= 1 ) { if( cmd[0] == "all" ) config.listSpec = List::All; else if( cmd[0] == "tests" ) config.listSpec = List::Tests; + else if( cmd[0] == "tags" ) + config.listSpec = List::Tags; else if( cmd[0] == "reporters" ) config.listSpec = List::Reports; else - cmd.raiseError( "Expected [tests] or [reporters]" ); + cmd.raiseError( "Expected tests, reporters or tags" ); } if( cmd.argsCount() >= 2 ) { if( cmd[1] == "xml" ) @@ -361,7 +365,7 @@ namespace Catch { else if( cmd[1] == "text" ) config.listSpec = static_cast<List::What>( config.listSpec | List::AsText ); else - cmd.raiseError( "Expected [xml] or [text]" ); + cmd.raiseError( "Expected xml or text" ); } } }; diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp index 1ef3fff6..0e5de388 100644 --- a/include/internal/catch_config.hpp +++ b/include/internal/catch_config.hpp @@ -34,9 +34,8 @@ namespace Catch { Reports = 1, Tests = 2, - All = 3, - - TestNames = 6, + Tags = 4, + All = Reports | Tests | Tags, WhatMask = 0xf, diff --git a/include/internal/catch_line_wrap.h b/include/internal/catch_line_wrap.h index 0ec49cdb..7cd08055 100644 --- a/include/internal/catch_line_wrap.h +++ b/include/internal/catch_line_wrap.h @@ -28,6 +28,7 @@ namespace Catch { const_iterator begin() const { return lines.begin(); } const_iterator end() const { return lines.end(); } + std::string const& last() const { return lines.back(); } std::size_t size() const { return lines.size(); } std::string const& operator[]( std::size_t _index ) const { return lines[_index]; } diff --git a/include/internal/catch_line_wrap.hpp b/include/internal/catch_line_wrap.hpp index a51e98a8..9c6f3019 100644 --- a/include/internal/catch_line_wrap.hpp +++ b/include/internal/catch_line_wrap.hpp @@ -66,7 +66,7 @@ namespace Catch { std::string withoutTab = _str.substr( 0, nextTab ) + _str.substr( nextTab+1 ); return wrapInternal( withoutTab ); } - else if( isWrapPoint( _str[pos] ) ) { + else if( pos > 0 && isWrapPoint( _str[pos] ) ) { wrapPoint = pos; } } diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index f7f0c657..458c3a21 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -36,8 +36,10 @@ namespace Catch { std::size_t maxTagLen = 0; std::size_t maxNameLen = 0; for(; it != itEnd; ++it ) { - maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); - maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); + if( matchesFilters( config.filters, *it ) ) { + maxTagLen = (std::max)( it->getTestCaseInfo().tagsAsString.size(), maxTagLen ); + maxNameLen = (std::max)( it->getTestCaseInfo().name.size(), maxNameLen ); + } } // Try to fit everything in. If not shrink tag column first, down to 30 @@ -66,9 +68,13 @@ namespace Catch { nameCol = nameWrapper[i]; else nameCol = " ..."; - std::cout << nameCol << " " << std::string( maxNameLen - nameCol.size(), ' ' ); - if( i < tagsWrapper.size() ) - std::cout << tagsWrapper[i]; + 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]; + } std::cout << "\n"; } } @@ -78,6 +84,54 @@ namespace Catch { else std::cout << pluralise( matchedTests, "matching test case" ) << std::endl; } + + inline void listTags( const ConfigData& config ) { + if( config.filters.empty() ) + std::cout << "All available tags:\n"; + else + std::cout << "Matching tags:\n"; + std::vector<TestCase> const& allTests = getRegistryHub().getTestCaseRegistry().getAllTests(); + std::vector<TestCase>::const_iterator it = allTests.begin(), itEnd = allTests.end(); + + std::map<std::string, int> tagCounts; + + std::size_t maxTagLen = 0; + + for(; it != itEnd; ++it ) { + if( matchesFilters( config.filters, *it ) ) { + for( std::set<std::string>::const_iterator tagIt = it->getTestCaseInfo().tags.begin(), + tagItEnd = it->getTestCaseInfo().tags.end(); + tagIt != tagItEnd; + ++tagIt ) { + std::string tagName = "[" + *tagIt + "]"; + maxTagLen = (std::max)( maxTagLen, tagName.size() ); + std::map<std::string, int>::iterator countIt = tagCounts.find( tagName ); + if( countIt == tagCounts.end() ) + tagCounts.insert( std::make_pair( tagName, 1 ) ); + else + countIt->second++; + } + } + } + maxTagLen +=2; + if( maxTagLen > CATCH_CONFIG_CONSOLE_WIDTH-10 ) + maxTagLen = CATCH_CONFIG_CONSOLE_WIDTH-10; + + for( std::map<std::string, int>::const_iterator countIt = tagCounts.begin(), countItEnd = tagCounts.end(); + countIt != countItEnd; + ++countIt ) { + LineWrapper wrapper; + wrapper.setIndent(2).setRight( maxTagLen ).wrap( countIt->first ); + + std::cout << wrapper; + if( maxTagLen > wrapper.last().size() ) + std::cout << std::string( maxTagLen - wrapper.last().size(), '.' ); + std::cout << ".. " + << countIt->second + << "\n"; + } + std::cout << pluralise( tagCounts.size(), "tag" ) << std::endl; + } inline void listReporters( const ConfigData& /*config*/ ) { std::cout << "Available reports:\n"; @@ -93,9 +147,11 @@ namespace Catch { inline void list( const ConfigData& config ) { if( config.listSpec & List::Tests ) listTests( config ); - else if( config.listSpec & List::Reports ) + if( config.listSpec & List::Tags ) + listTags( config ); + if( config.listSpec & List::Reports ) listReporters( config ); - else + if( ( config.listSpec & List::All ) == 0 ) throw std::logic_error( "Unknown list type" ); } diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt index 43fd126a..cc251b7e 100644 --- a/projects/SelfTest/Baselines/approvedResults.txt +++ b/projects/SelfTest/Baselines/approvedResults.txt @@ -3673,8 +3673,8 @@ TestMain.cpp:226: 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" ------------------------------------------------------------------------------- selftest/parser/2 @@ -3686,8 +3686,8 @@ TestMain.cpp:230: 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" ------------------------------------------------------------------------------- selftest/parser/2 @@ -4173,7 +4173,7 @@ Long strings can be wrapped TestMain.cpp:435: PASSED: - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == @@ -4181,7 +4181,7 @@ with expansion: TestMain.cpp:436: PASSED: - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" == @@ -4195,7 +4195,7 @@ Long strings can be wrapped TestMain.cpp:439: PASSED: - CHECK( Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4205,7 +4205,7 @@ with expansion: TestMain.cpp:440: PASSED: - CHECK( Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4215,7 +4215,7 @@ with expansion: TestMain.cpp:441: PASSED: - CHECK( Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4225,7 +4225,7 @@ with expansion: TestMain.cpp:442: PASSED: - CHECK( Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" ) + CHECK( Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" ) with expansion: "one two three four" @@ -4235,7 +4235,7 @@ with expansion: TestMain.cpp:443: PASSED: - CHECK( Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" ) + CHECK( Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" ) with expansion: "one two three four" @@ -4251,7 +4251,7 @@ Long strings can be wrapped TestMain.cpp:446: PASSED: - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4263,7 +4263,7 @@ with expansion: TestMain.cpp:447: PASSED: - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4281,7 +4281,7 @@ Long strings can be wrapped TestMain.cpp:450: PASSED: - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4295,7 +4295,7 @@ with expansion: TestMain.cpp:451: PASSED: - CHECK( Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4315,7 +4315,7 @@ Long strings can be wrapped TestMain.cpp:454: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdef" ).toString() == "abc-\ndef" ) with expansion: "abc- def" @@ -4325,7 +4325,7 @@ with expansion: TestMain.cpp:455: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( "abcdefg" ).toString() == "abc-\ndefg" ) with expansion: "abc- defg" @@ -4335,7 +4335,7 @@ with expansion: TestMain.cpp:456: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap("abcdefgh" ).toString() == "abc-\ndef-\ngh" ) with expansion: "abc- def- @@ -4347,7 +4347,7 @@ with expansion: TestMain.cpp:458: PASSED: - CHECK( Catch::LineWrapper( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) + CHECK( Catch::LineWrapper().setRight( 4 ).wrap( testString ).toString() == "one\ntwo\nthr-\nee\nfour" ) with expansion: "one two @@ -4363,7 +4363,7 @@ with expansion: TestMain.cpp:459: PASSED: - CHECK( Catch::LineWrapper( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) + CHECK( Catch::LineWrapper().setRight( 3 ).wrap( testString ).toString() == "one\ntwo\nth-\nree\nfo-\nur" ) with expansion: "one two @@ -4381,13 +4381,49 @@ with expansion: ------------------------------------------------------------------------------- Long strings can be wrapped + plain string + As container +............................................................................... + +TestMain.cpp:464: +PASSED: + CHECK( wrapper.size() == 4 ) +with expansion: + 4 == 4 + +TestMain.cpp:465: +PASSED: + CHECK( wrapper[0] == "one" ) +with expansion: + "one" == "one" + +TestMain.cpp:466: +PASSED: + CHECK( wrapper[1] == "two" ) +with expansion: + "two" == "two" + +TestMain.cpp:467: +PASSED: + CHECK( wrapper[2] == "three" ) +with expansion: + "three" == "three" + +TestMain.cpp:468: +PASSED: + CHECK( wrapper[3] == "four" ) +with expansion: + "four" == "four" + +------------------------------------------------------------------------------- +Long strings can be wrapped With newlines No wrapping ............................................................................... -TestMain.cpp:469: +TestMain.cpp:478: PASSED: - CHECK( Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4395,9 +4431,9 @@ with expansion: "one two three four" -TestMain.cpp:470: +TestMain.cpp:479: PASSED: - CHECK( Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4405,9 +4441,9 @@ with expansion: "one two three four" -TestMain.cpp:471: +TestMain.cpp:480: PASSED: - CHECK( Catch::LineWrapper( 10 ).wrap( testString ).toString() == testString ) + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( testString ).toString() == testString ) with expansion: "one two three four" @@ -4421,9 +4457,9 @@ Long strings can be wrapped Trailing newline ............................................................................... -TestMain.cpp:474: +TestMain.cpp:483: PASSED: - CHECK( Catch::LineWrapper( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Catch::LineWrapper().setRight( 10 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4431,15 +4467,15 @@ with expansion: "abcdef " -TestMain.cpp:475: +TestMain.cpp:484: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef" ).toString() == "abcdef" ) with expansion: "abcdef" == "abcdef" -TestMain.cpp:476: +TestMain.cpp:485: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( "abcdef\n" ).toString() == "abcdef\n" ) with expansion: "abcdef " @@ -4453,9 +4489,9 @@ Long strings can be wrapped Wrapped once ............................................................................... -TestMain.cpp:479: +TestMain.cpp:488: PASSED: - CHECK( Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4465,9 +4501,9 @@ with expansion: three four" -TestMain.cpp:480: +TestMain.cpp:489: PASSED: - CHECK( Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4477,9 +4513,9 @@ with expansion: three four" -TestMain.cpp:481: +TestMain.cpp:490: PASSED: - CHECK( Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one two\nthree\nfour" ) with expansion: "one two three @@ -4495,9 +4531,9 @@ Long strings can be wrapped Wrapped twice ............................................................................... -TestMain.cpp:484: +TestMain.cpp:493: PASSED: - CHECK( Catch::LineWrapper( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) + CHECK( Catch::LineWrapper().setRight( 6 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" ) with expansion: "one two @@ -4785,9 +4821,9 @@ with expansion: ------------------------------------------------------------------------------- Scenario: Do that thing with the thing - Given: This stuff exists - When: I do this - Then: it should do this + Given: This stuff exists + When: I do this + Then: it should do this ............................................................................... BDDTests.cpp:21: @@ -4798,10 +4834,10 @@ with expansion: ------------------------------------------------------------------------------- Scenario: Do that thing with the thing - Given: This stuff exists - When: I do this - Then: it should do this - And: do that + Given: This stuff exists + When: I do this + Then: it should do this + And: do that ............................................................................... BDDTests.cpp:23: @@ -4811,6 +4847,165 @@ with expansion: true ------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up + And when: it is made smaller again + Then: the size goes down but the capacity stays the same +............................................................................... + +BDDTests.cpp:43: +PASSED: + REQUIRE( v.size() == 5 ) +with expansion: + 5 == 5 + +BDDTests.cpp:44: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: it is made larger + Then: the size and capacity go up +............................................................................... + +BDDTests.cpp:37: +PASSED: + REQUIRE( v.size() == 10 ) +with expansion: + 10 == 10 + +BDDTests.cpp:38: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector +............................................................................... + +BDDTests.cpp:32: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: Vector resizing affects size and capacity + Given: an empty vector + When: we reserve more space + Then: The capacity is increased but the size remains the same +............................................................................... + +BDDTests.cpp:53: +PASSED: + REQUIRE( v.capacity() >= 10 ) +with expansion: + 10 >= 10 + +BDDTests.cpp:54: +PASSED: + REQUIRE( v.size() == 0 ) +with expansion: + 0 == 0 + +------------------------------------------------------------------------------- +Scenario: This is a really long scenario name to see how the list command deals with wrapping +............................................................................... + + +No assertions in test case, 'Scenario: This is a really long scenario name to see how the list command deals with wrapping' + +------------------------------------------------------------------------------- Anonymous test case 1 ............................................................................... @@ -4839,7 +5034,7 @@ with message: no assertions =============================================================================== -106 test cases - 47 failed (676 assertions - 104 failed) +108 test cases - 48 failed (697 assertions - 105 failed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -5134,7 +5329,7 @@ with expansion: 13 test cases - 3 failed (40 assertions - 4 failed) <testsuites> - <testsuite name="~dummy" errors="9" failures="77" tests="676" hostname="tbd" time="tbd" timestamp="tbd"> + <testsuite name="~dummy" errors="9" failures="77" tests="697" hostname="tbd" time="tbd" timestamp="tbd"> <testcase classname="global" name="./succeeding/Approx/simple" time="tbd"/> <testcase classname="global" name="./succeeding/Approx/epsilon" time="tbd"/> <testcase classname="global" name="./succeeding/Approx/float" time="tbd"/> @@ -5574,6 +5769,8 @@ TrickyTests.cpp:106 <testcase classname="global" name="./succeeding/SafeBool" time="tbd"/> <testcase classname="global" name="Assertions then sections" time="tbd"/> <testcase classname="global" name="Scenario: Do that thing with the thing" time="tbd"/> + <testcase classname="global" name="Scenario: Vector resizing affects size and capacity" time="tbd"/> + <testcase classname="global" name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" time="tbd"/> <testcase classname="global" name="Anonymous test case 1" time="tbd"/> <testcase classname="global" name="Test case with one argument" time="tbd"/> <testcase classname="global" name="Variadic macros" time="tbd"/> @@ -10377,7 +10574,7 @@ TestMain.cpp" line="423"> <Section name="No wrapping"> TestMain.cpp" line="435"> <Original> - Catch::LineWrapper( 80 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 80 ).wrap( testString ).toString() == testString </Original> <Expanded> "one two three four" @@ -10387,7 +10584,7 @@ TestMain.cpp" line="435"> </Expression> TestMain.cpp" line="436"> <Original> - Catch::LineWrapper( 18 ).wrap( testString ).toString() == testString + Catch::LineWrapper().setRight( 18 ).wrap( testString ).toString() == testString </Original> <Expanded> "one two three four" @@ -10403,7 +10600,7 @@ TestMain.cpp" line="436"> <Section name="Wrapped once"> TestMain.cpp" line="439"> <Original> - Catch::LineWrapper( 17 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 17 ).wrap( testString ).toString() == "one two three\nfour" </Original> <Expanded> "one two three @@ -10415,7 +10612,7 @@ four" </Expression> TestMain.cpp" line="440"> <Original> - Catch::LineWrapper( 16 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 16 ).wrap( testString ).toString() == "one two three\nfour" </Original> <Expanded> "one two three @@ -10427,7 +10624,7 @@ four" </Expression> TestMain.cpp" line="441"> <Original> - Catch::LineWrapper( 15 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 15 ).wrap( testString ).toString() == "one two three\nfour" </Original> <Expanded> "one two three @@ -10439,7 +10636,7 @@ four" </Expression> TestMain.cpp" line="442"> <Original> - Catch::LineWrapper( 14 ).wrap( testString ).toString() == "one two three\nfour" + Catch::LineWrapper().setRight( 14 ).wrap( testString ).toString() == "one two three\nfour" </Original> <Expanded> "one two three @@ -10451,7 +10648,7 @@ four" </Expression> TestMain.cpp" line="443"> <Original> - Catch::LineWrapper( 13 ).wrap( testString ).toString() == "one two\nthree four" + Catch::LineWrapper().setRight( 13 ).wrap( testString ).toString() == "one two\nthree four" </Original> <Expanded> "one two @@ -10469,7 +10666,7 @@ three four" <Section name="Wrapped twice"> TestMain.cpp" line="446"> <Original> - Catch::LineWrapper( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 9 ).wrap( testString ).toString() == "one two\nthree\nfour" </Original> <Expanded> "one two @@ -10483,7 +10680,7 @@ four" </Expression> TestMain.cpp" line="447"> <Original> - Catch::LineWrapper( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" + Catch::LineWrapper().setRight( 8 ).wrap( testString ).toString() == "one two\nthree\nfour" </Original> <Expanded> "one two @@ -10503,7 +10700,7 @@ four" <Section name="Wrapped three times"> TestMain.cpp" line="450"> <Original> - Catch::LineWrapper( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Catch::LineWrapper().setRight( 7 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" </Original> <Expanded> "one @@ -10519,7 +10716,7 @@ four" </Expression> TestMain.cpp" line="451"> <Original> - Catch::LineWrapper( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" + Catch::LineWrapper().setRight( 5 ).wrap( testString ).toString() == "one\ntwo\nthree\nfour" </Original> <Expanded> |