Replaced some uses of tbc_text_format with TextFlow (from Clara)

This commit is contained in:
Phil Nash
2017-07-18 20:27:42 +01:00
parent d43024ff6b
commit b0e3f45a22
5 changed files with 41 additions and 40 deletions

View File

@@ -14,7 +14,6 @@
#include "internal/catch_run_context.hpp"
#include "internal/catch_test_spec.hpp"
#include "internal/catch_version.h"
#include "internal/catch_text.h"
#include "internal/catch_interfaces_reporter.h"
#include "internal/catch_startup_exception_registry.h"
@@ -24,6 +23,8 @@
namespace Catch {
using namespace clara::TextFlow;
IStreamingReporterPtr createReporter( std::string const& reporterName, IConfigPtr const& config ) {
auto reporter = getRegistryHub().getReporterRegistry().create( reporterName, config );
CATCH_ENFORCE( reporter, "No reporter registered with name: '" << reporterName << "'" );
@@ -120,13 +121,12 @@ namespace Catch {
int applyCommandLine( int argc, char* argv[] ) {
auto result = m_cli.parse( clara::Args( argc, argv ) );
if( !result ) {
{
Colour colourGuard( Colour::Red );
Catch::cerr()
<< "\nError(s) in input:\n"
<< Text( result.errorMessage(), TextAttributes().setIndent(2) )
<< "\n\n";
}
Catch::cerr()
<< Colour( Colour::Red )
<< "\nError(s) in input:\n"
<< Column( result.errorMessage() ).indent( 2 )
<< "\n\n";
Catch::cerr() << m_cli << std::endl;
return MaxExitCode;
}