Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2017-07-19 23:15:54 +0200
committerMartin Hořeňovský2017-07-19 23:17:19 +0200
commitcf2678dce6256a4d89d9912e541fde1968f4ebdd (patch)
treec13d9b7799fdaaee2d847248850bdb39e3704f74 /include/internal
parentd7f754dc4934efb898e6d70e66d19302cf9a5a4b (diff)
parentaf05ccfe5d9096e203f63e5cde07e6767f532334 (diff)
downloadcatch3-cf2678dce6256a4d89d9912e541fde1968f4ebdd.tar.gz
Merge branch 'dev-better-verbosity' of https://github.com/BMBurstein/Catch
Diffstat (limited to 'include/internal')
-rw-r--r--include/internal/catch_config.cpp3
-rw-r--r--include/internal/catch_config.hpp3
-rw-r--r--include/internal/catch_impl.hpp1
-rw-r--r--include/internal/catch_interfaces_config.h1
-rw-r--r--include/internal/catch_interfaces_reporter.h4
-rw-r--r--include/internal/catch_list.cpp15
6 files changed, 15 insertions, 12 deletions
diff --git a/include/internal/catch_config.cpp b/include/internal/catch_config.cpp
index cf7c0c6e..dd3bbdc6 100644
--- a/include/internal/catch_config.cpp
+++ b/include/internal/catch_config.cpp
@@ -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() )
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
index add50100..36894bec 100644
--- a/include/internal/catch_config.hpp
+++ b/include/internal/catch_config.hpp
@@ -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:
diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp
index 94696662..aa196c2d 100644
--- a/include/internal/catch_impl.hpp
+++ b/include/internal/catch_impl.hpp
@@ -55,7 +55,6 @@ namespace Catch {
IMutableRegistryHub::~IMutableRegistryHub() {}
IExceptionTranslator::~IExceptionTranslator() {}
IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
-
IRunner::~IRunner() {}
IMutableContext::~IMutableContext() {}
IConfig::~IConfig() {}
diff --git a/include/internal/catch_interfaces_config.h b/include/internal/catch_interfaces_config.h
index 75499014..d2d7602c 100644
--- a/include/internal/catch_interfaces_config.h
+++ b/include/internal/catch_interfaces_config.h
@@ -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>;
diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
index eb419a20..0aa2d241 100644
--- a/include/internal/catch_interfaces_reporter.h
+++ b/include/internal/catch_interfaces_reporter.h
@@ -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;
diff --git a/include/internal/catch_list.cpp b/include/internal/catch_list.cpp
index b8c4cc2f..1d5f9e49 100644
--- a/include/internal/catch_list.cpp
+++ b/include/internal/catch_list.cpp
@@ -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";