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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/interfaces
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-08 00:01:31 +0200
committerMartin Hořeňovský2021-09-08 00:01:31 +0200
commit29caae5ce544858d86d680b783d4c8a3126f3b5d (patch)
tree0c0a04bc08bf9379e14dd6b22d392152363a5fce /src/catch2/interfaces
parentea49210eae6d04aae48d54bccc2a69776b3c6fd0 (diff)
downloadcatch3-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.hpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.cpp3
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp4
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 {