aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/testing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/testing.cpp')
-rw-r--r--src/zencore/testing.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/zencore/testing.cpp b/src/zencore/testing.cpp
index ef8fb0480..6000bd95c 100644
--- a/src/zencore/testing.cpp
+++ b/src/zencore/testing.cpp
@@ -1,18 +1,23 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#define ZEN_TEST_WITH_RUNNER 1
+
#include "zencore/testing.h"
+
+#include "zencore/filesystem.h"
#include "zencore/logging.h"
+#include "zencore/process.h"
+#include "zencore/trace.h"
#if ZEN_WITH_TESTS
# include <chrono>
+# include <clocale>
# include <cstdlib>
# include <cstdio>
# include <string>
# include <vector>
-# include <doctest/doctest.h>
-
namespace zen::testing {
using namespace std::literals;
@@ -149,6 +154,34 @@ TestRunner::Run()
return m_Impl->Session.run();
}
+int
+RunTestMain(int argc, char* argv[], [[maybe_unused]] const char* traceName, void (*forceLink)())
+{
+# if ZEN_PLATFORM_WINDOWS
+ setlocale(LC_ALL, "en_us.UTF8");
+# endif
+
+ forceLink();
+
+# if ZEN_PLATFORM_LINUX
+ zen::IgnoreChildSignals();
+# endif
+
+# if ZEN_WITH_TRACE
+ zen::TraceInit(traceName);
+ zen::TraceOptions TraceCommandlineOptions;
+ if (GetTraceOptionsFromCommandline(TraceCommandlineOptions))
+ {
+ TraceConfigure(TraceCommandlineOptions);
+ }
+# endif
+
+ zen::logging::InitializeLogging();
+ zen::MaximizeOpenFileCount();
+
+ return ZEN_RUN_TESTS(argc, argv);
+}
+
} // namespace zen::testing
#endif // ZEN_WITH_TESTS