Pass around the test suite name by StringRef

This commit is contained in:
Martin Hořeňovský
2021-09-08 00:01:31 +02:00
parent ea49210eae
commit 29caae5ce5
6 changed files with 8 additions and 10 deletions
@@ -9,6 +9,7 @@
#define CATCH_INTERFACES_CONFIG_HPP_INCLUDED
#include <catch2/internal/catch_noncopyable.hpp>
#include <catch2/internal/catch_stringref.hpp>
#include <chrono>
#include <iosfwd>
@@ -59,7 +60,7 @@ namespace Catch {
virtual bool allowThrows() const = 0;
virtual std::ostream& stream() const = 0;
virtual std::string name() const = 0;
virtual StringRef name() const = 0;
virtual bool includeSuccessfulResults() const = 0;
virtual bool shouldDebugBreak() const = 0;
virtual bool warnAboutMissingAssertions() const = 0;
@@ -29,9 +29,6 @@ namespace Catch {
std::ostream& ReporterConfig::stream() const { return *m_stream; }
IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
TestRunInfo::TestRunInfo( std::string const& _name ) : name( _name ) {}
AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
std::vector<MessageInfo> const& _infoMessages,
Totals const& _totals )
@@ -45,8 +45,8 @@ namespace Catch {
};
struct TestRunInfo {
TestRunInfo( std::string const& _name );
std::string name;
TestRunInfo(StringRef _name) : name(_name) {}
StringRef name;
};
struct AssertionStats {