Merge branch 'dev-better-verbosity' of https://github.com/BMBurstein/Catch

This commit is contained in:
Martin Hořeňovský
2017-07-19 23:15:54 +02:00
18 changed files with 293 additions and 269 deletions

View File

@@ -30,8 +30,6 @@ namespace Catch {
bool Config::listTags() const { return m_data.listTags; }
bool Config::listReporters() const { return m_data.listReporters; }
Verbosity Config::verbosity() const { return m_data.verbosity; }
std::string Config::getProcessName() const { return m_data.processName; }
std::vector<std::string> const& Config::getReporterNames() const { return m_data.reporterNames; }
@@ -54,6 +52,7 @@ namespace Catch {
bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
int Config::abortAfter() const { return m_data.abortAfter; }
bool Config::showInvisibles() const { return m_data.showInvisibles; }
Verbosity Config::verbosity() const { return m_data.verbosity; }
IStream const* Config::openStream() {
if( m_data.outputFilename.empty() )

View File

@@ -70,8 +70,6 @@ namespace Catch {
bool listTags() const;
bool listReporters() const;
Verbosity verbosity() const;
std::string getProcessName() const;
std::vector<std::string> const& getReporterNames() const;
@@ -94,6 +92,7 @@ namespace Catch {
virtual bool shouldDebugBreak() const override;
virtual int abortAfter() const override;
virtual bool showInvisibles() const override;
virtual Verbosity verbosity() const override;
private:

View File

@@ -55,7 +55,6 @@ namespace Catch {
IMutableRegistryHub::~IMutableRegistryHub() {}
IExceptionTranslator::~IExceptionTranslator() {}
IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
IRunner::~IRunner() {}
IMutableContext::~IMutableContext() {}
IConfig::~IConfig() {}

View File

@@ -64,6 +64,7 @@ namespace Catch {
virtual unsigned int rngSeed() const = 0;
virtual UseColour::YesOrNo useColour() const = 0;
virtual std::vector<std::string> const& getSectionsToRun() const = 0;
virtual Verbosity verbosity() const = 0;
};
using IConfigPtr = std::shared_ptr<IConfig const>;

View File

@@ -22,6 +22,7 @@
#include <string>
#include <iosfwd>
#include <map>
#include <set>
#include <memory>
namespace Catch {
@@ -162,8 +163,9 @@ namespace Catch {
struct IStreamingReporter {
virtual ~IStreamingReporter() = default;
// Implementing class must also provide the following static method:
// Implementing class must also provide the following static methods:
// static std::string getDescription();
// static std::set<Verbosity> getSupportedVerbosities()
virtual ReporterPreferences getPreferences() const = 0;

View File

@@ -12,6 +12,8 @@
#include "catch_interfaces_reporter.h"
#include "catch_interfaces_testcase.h"
#include "catch_text.h"
#include "catch_clara.h" // For TextFlow
#include "catch_console_colour.hpp"
@@ -43,12 +45,13 @@ namespace Catch {
Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
if( config.verbosity() >= Verbosity::High ) {
std::string description = testCaseInfo.description.empty()
? std::string( "(NO DESCRIPTION)" )
: testCaseInfo.description;
Catch::cout()
<< " " << testCaseInfo.lineInfo << "\n"
<< Column( description ).indent( 4 ) << "\n";
TextAttributes descAttr;
descAttr.setIndent( 4 );
Catch::cout() << Text( testCaseInfo.lineInfo, descAttr ) << std::endl;
std::string description = testCaseInfo.description;
if( description == "" )
description = "(NO DESCRIPTION)";
Catch::cout() << Text( description, descAttr ) << std::endl;
}
if( !testCaseInfo.tags.empty() )
Catch::cout() << Column( testCaseInfo.tagsAsString ).indent( 6 ) << "\n";