aboutsummaryrefslogtreecommitdiff
path: root/zenutil
diff options
context:
space:
mode:
Diffstat (limited to 'zenutil')
-rw-r--r--zenutil/include/zenserverprocess.h3
-rw-r--r--zenutil/zenserverprocess.cpp15
2 files changed, 16 insertions, 2 deletions
diff --git a/zenutil/include/zenserverprocess.h b/zenutil/include/zenserverprocess.h
index d0093537e..f7d911a87 100644
--- a/zenutil/include/zenserverprocess.h
+++ b/zenutil/include/zenserverprocess.h
@@ -55,6 +55,8 @@ struct ZenServerInstance
void AttachToRunningServer(int BasePort = 0);
+ std::string GetBaseUri() const;
+
private:
ZenServerEnvironment& m_Env;
zen::ProcessHandle m_Process;
@@ -63,6 +65,7 @@ private:
bool m_Terminate = false;
std::filesystem::path m_TestDir;
bool m_MeshEnabled = false;
+ int m_BasePort = 0;
void CreateShutdownEvent(int BasePort);
};
diff --git a/zenutil/zenserverprocess.cpp b/zenutil/zenserverprocess.cpp
index 4e45ddfae..093f18f6a 100644
--- a/zenutil/zenserverprocess.cpp
+++ b/zenutil/zenserverprocess.cpp
@@ -403,6 +403,7 @@ ZenServerInstance::SpawnServer(int BasePort)
if (BasePort)
{
CommandLine << " --port " << BasePort;
+ m_BasePort = BasePort;
}
if (!m_TestDir.empty())
@@ -418,7 +419,7 @@ ZenServerInstance::SpawnServer(int BasePort)
std::filesystem::path CurrentDirectory = std::filesystem::current_path();
- spdlog::debug("Spawning server");
+ spdlog::debug("Spawning server '{}'", LogId);
PROCESS_INFORMATION ProcessInfo{};
STARTUPINFO StartupInfo{.cb = sizeof(STARTUPINFO)};
@@ -492,7 +493,7 @@ ZenServerInstance::SpawnServer(int BasePort)
}
}
- spdlog::debug("Server spawned OK");
+ spdlog::debug("Server '{}' spawned OK", LogId);
if (IsTest)
{
@@ -558,3 +559,13 @@ ZenServerInstance::WaitUntilReady(int Timeout)
{
return m_ReadyEvent.Wait(Timeout);
}
+
+std::string
+ZenServerInstance::GetBaseUri() const
+{
+ ZEN_ASSERT(m_BasePort);
+
+ using namespace fmt::literals;
+
+ return "http://localhost:{}"_format(m_BasePort);
+}