aboutsummaryrefslogtreecommitdiff
path: root/src/zennet-test/zennet-test.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-25 12:21:51 +0200
committerGitHub <[email protected]>2023-10-25 12:21:51 +0200
commit0b220255724020daea18ddb559f5edf3fdb1621b (patch)
tree7809227752c15d90111c4e600d80b59d90ad25d2 /src/zennet-test/zennet-test.cpp
parentNew rotating file logger that keeps on running regardless of errors (#495) (diff)
downloadzen-0b220255724020daea18ddb559f5edf3fdb1621b.tar.xz
zen-0b220255724020daea18ddb559f5edf3fdb1621b.zip
statsd metrics reporting (#496)
added support for reporting metrics via statsd style UDP messaging, which is supported by many monitoring solution providers this change adds reporting only of three cache related metrics (hit/miss/put) but this should be extended to include more metrics after additional evaluation
Diffstat (limited to 'src/zennet-test/zennet-test.cpp')
-rw-r--r--src/zennet-test/zennet-test.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/zennet-test/zennet-test.cpp b/src/zennet-test/zennet-test.cpp
new file mode 100644
index 000000000..b133f246c
--- /dev/null
+++ b/src/zennet-test/zennet-test.cpp
@@ -0,0 +1,52 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#include "zennet-test.h"
+#include <zencore/fmtutils.h>
+#include <zencore/logging.h>
+#include <zencore/timer.h>
+#include <zennet/zennet.h>
+#include <zenutil/zenserverprocess.h>
+
+#if ZEN_USE_MIMALLOC
+ZEN_THIRD_PARTY_INCLUDES_START
+# include <mimalloc.h>
+ZEN_THIRD_PARTY_INCLUDES_END
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+
+#if ZEN_WITH_TESTS
+# define ZEN_TEST_WITH_RUNNER 1
+# include <zencore/testing.h>
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+
+using namespace std::literals;
+
+zen::ZenServerEnvironment TestEnv;
+
+int
+main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
+{
+#if ZEN_USE_MIMALLOC
+ mi_version();
+#endif
+
+#if ZEN_WITH_TESTS
+ zen::zennet_forcelinktests();
+
+ zen::logging::InitializeLogging();
+
+ std::filesystem::path ProgramBaseDir = std::filesystem::path(argv[0]).parent_path();
+ std::filesystem::path TestBaseDir = ProgramBaseDir.parent_path().parent_path() / ".test";
+
+ TestEnv.InitializeForTest(ProgramBaseDir, TestBaseDir);
+
+ ZEN_INFO("Running tests...(base dir: '{}')", TestBaseDir);
+
+ return ZEN_RUN_TESTS(argc, argv);
+#else
+ return 0;
+#endif
+}