mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Allows console line width to be configured (and defaults to 80).
Line wrap is at console width-1
This commit is contained in:
parent
3682433c2f
commit
67ccd8d74a
@ -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 {
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user