Allows console line width to be configured (and defaults to 80).

Line wrap is at console width-1
This commit is contained in:
Phil Nash 2013-01-26 20:06:55 +00:00
parent 3682433c2f
commit 67ccd8d74a
3 changed files with 338 additions and 337 deletions

View File

@ -18,6 +18,10 @@
#include <string>
#include <iostream>
#ifndef CATCH_CONFIG_CONSOLE_WIDTH
#define CATCH_CONFIG_CONSOLE_WIDTH 80
#endif
namespace Catch {
struct Include { enum WhichResults {

View File

@ -199,7 +199,7 @@ namespace Catch {
}
static std::string wrapLongStrings( std::string const& _string ){
return Catch::wrapLongStrings( _string, 70, 2 );
return Catch::wrapLongStrings( _string, CATCH_CONFIG_CONSOLE_WIDTH-1, 2 );
}
std::ostream& stream;
@ -330,18 +330,15 @@ namespace Catch {
stream << getDashes() << "\n";
}
static std::string const& getDashes() {
static const std::string dashes
= "-----------------------------------------------------------------";
static const std::string dashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '-' );
return dashes;
}
static std::string const& getDots() {
static const std::string dots
= ".................................................................";
static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '.' );
return dots;
}
static std::string const& getDoubleDashes() {
static const std::string doubleDashes
= "=================================================================";
static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' );
return doubleDashes;
}

File diff suppressed because it is too large Load Diff