diff options
| author | Martin Hořeňovský | 2021-09-08 00:01:31 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-09-08 00:01:31 +0200 |
| commit | 29caae5ce544858d86d680b783d4c8a3126f3b5d (patch) | |
| tree | 0c0a04bc08bf9379e14dd6b22d392152363a5fce /src/catch2/interfaces | |
| parent | ea49210eae6d04aae48d54bccc2a69776b3c6fd0 (diff) | |
| download | catch3-29caae5ce544858d86d680b783d4c8a3126f3b5d.tar.gz | |
Pass around the test suite name by StringRef
Diffstat (limited to 'src/catch2/interfaces')
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_config.hpp | 3 | ||||
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.cpp | 3 | ||||
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.hpp | 4 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_config.hpp b/src/catch2/interfaces/catch_interfaces_config.hpp index f09b0c0f..60c4e9be 100644 --- a/src/catch2/interfaces/catch_interfaces_config.hpp +++ b/src/catch2/interfaces/catch_interfaces_config.hpp @@ -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; diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 81892e82..22994309 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -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 ) diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index 2e64d73e..09480f04 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -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 { |