mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +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 <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifndef CATCH_CONFIG_CONSOLE_WIDTH
|
||||||
|
#define CATCH_CONFIG_CONSOLE_WIDTH 80
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
struct Include { enum WhichResults {
|
struct Include { enum WhichResults {
|
||||||
|
@ -199,7 +199,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::string wrapLongStrings( std::string const& _string ){
|
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;
|
std::ostream& stream;
|
||||||
@ -330,18 +330,15 @@ namespace Catch {
|
|||||||
stream << getDashes() << "\n";
|
stream << getDashes() << "\n";
|
||||||
}
|
}
|
||||||
static std::string const& getDashes() {
|
static std::string const& getDashes() {
|
||||||
static const std::string dashes
|
static const std::string dashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '-' );
|
||||||
= "-----------------------------------------------------------------";
|
|
||||||
return dashes;
|
return dashes;
|
||||||
}
|
}
|
||||||
static std::string const& getDots() {
|
static std::string const& getDots() {
|
||||||
static const std::string dots
|
static const std::string dots( CATCH_CONFIG_CONSOLE_WIDTH-1, '.' );
|
||||||
= ".................................................................";
|
|
||||||
return dots;
|
return dots;
|
||||||
}
|
}
|
||||||
static std::string const& getDoubleDashes() {
|
static std::string const& getDoubleDashes() {
|
||||||
static const std::string doubleDashes
|
static const std::string doubleDashes( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' );
|
||||||
= "=================================================================";
|
|
||||||
return doubleDashes;
|
return doubleDashes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user