Files
DarkflameServer/tests/dWebTests/WebTestDependencies.cpp
Aaron Kimbrell e213a7aeff feat: web dashboard and playground work
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch:
accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy
reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live
events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved
captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes
they need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:30:43 -05:00

28 lines
750 B
C++

#include <gtest/gtest.h>
#include <filesystem>
#include "Game.h"
#include "Logger.h"
class dConfig;
namespace Game {
Logger* logger = nullptr;
dConfig* config = nullptr; // code under test treats a missing config as all defaults
}
// Code under test logs through Game::logger, so give it a real logger writing to a temp file
class WebTestEnvironment : public ::testing::Environment {
public:
void SetUp() override {
const auto path = std::filesystem::temp_directory_path() / "dWebTests.log";
Game::logger = new Logger(path.string(), false, false);
}
void TearDown() override {
delete Game::logger;
Game::logger = nullptr;
}
};
static const auto* const g_Environment = ::testing::AddGlobalTestEnvironment(new WebTestEnvironment());