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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorChris Thrasher2025-04-25 23:32:34 -0600
committerChris Thrasher2025-04-29 09:26:28 -0600
commit5abfc0aa9c1ef4cb40c9f387495134dab02e1af2 (patch)
tree8cf1636bf151a0de6ed81617532a0336e69b1896 /src/catch2
parent1e7b879fae7896b9222b8fefc11fea3f24864103 (diff)
downloadcatch3-5abfc0aa9c1ef4cb40c9f387495134dab02e1af2.tar.gz
Add return code constants to API
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/catch_session.cpp8
-rw-r--r--src/catch2/catch_session.hpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp
index 0fb45ba7..7542447b 100644
--- a/src/catch2/catch_session.cpp
+++ b/src/catch2/catch_session.cpp
@@ -33,14 +33,6 @@
namespace Catch {
namespace {
- static constexpr int TestFailureExitCode = 42;
- static constexpr int UnspecifiedErrorExitCode = 1;
- static constexpr int AllTestsSkippedExitCode = 4;
- static constexpr int NoTestsRunExitCode = 2;
- static constexpr int UnmatchedTestSpecExitCode = 3;
- static constexpr int InvalidTestSpecExitCode = 5;
-
-
IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) {
auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config));
CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\'');
diff --git a/src/catch2/catch_session.hpp b/src/catch2/catch_session.hpp
index c1de6d57..23fc6f80 100644
--- a/src/catch2/catch_session.hpp
+++ b/src/catch2/catch_session.hpp
@@ -16,6 +16,14 @@
namespace Catch {
+ // TODO: Use C++17 `inline` variables
+ constexpr int UnspecifiedErrorExitCode = 1;
+ constexpr int NoTestsRunExitCode = 2;
+ constexpr int UnmatchedTestSpecExitCode = 3;
+ constexpr int AllTestsSkippedExitCode = 4;
+ constexpr int InvalidTestSpecExitCode = 5;
+ constexpr int TestFailureExitCode = 42;
+
class Session : Detail::NonCopyable {
public: