aboutsummaryrefslogtreecommitdiff
path: root/zentestutil/zenserverprocess.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-06-18 15:43:23 +0200
committerStefan Boberg <[email protected]>2021-06-18 15:43:23 +0200
commit9e97f5eef6c89f02f5b0c04886fbc3670e243856 (patch)
tree2d21ef998fa6f8ae0b92e2f01085ca25b634f0d6 /zentestutil/zenserverprocess.cpp
parentAdded simple control of test executable exit code (diff)
downloadzen-9e97f5eef6c89f02f5b0c04886fbc3670e243856.tar.xz
zen-9e97f5eef6c89f02f5b0c04886fbc3670e243856.zip
Added ZenTestEnvironment::RootDir to construct a path to a subdirectory in the project tree
Diffstat (limited to 'zentestutil/zenserverprocess.cpp')
-rw-r--r--zentestutil/zenserverprocess.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/zentestutil/zenserverprocess.cpp b/zentestutil/zenserverprocess.cpp
index 9d62d692f..04314bc5f 100644
--- a/zentestutil/zenserverprocess.cpp
+++ b/zentestutil/zenserverprocess.cpp
@@ -26,7 +26,8 @@ ZenTestEnvironment::Initialize(std::filesystem::path ProgramBaseDir, std::filesy
m_ProgramBaseDir = ProgramBaseDir;
m_TestBaseDir = TestBaseDir;
- spdlog::info("Cleaning '{}'", TestBaseDir);
+ spdlog::info("Program base dir is '{}'", ProgramBaseDir);
+ spdlog::info("Cleaning test base dir '{}'", TestBaseDir);
zen::DeleteDirectories(TestBaseDir.c_str());
m_IsInitialized = true;
@@ -42,11 +43,23 @@ ZenTestEnvironment::CreateNewTestDir()
std::filesystem::path TestPath = m_TestBaseDir / TestDir.c_str();
+ spdlog::info("Creating new test dir @ '{}'", TestPath);
+
zen::CreateDirectories(TestPath.c_str());
return TestPath;
}
+std::filesystem::path
+ZenTestEnvironment::RootDir(std::string_view Path)
+{
+ std::filesystem::path Root = m_ProgramBaseDir.parent_path().parent_path();
+
+ std::filesystem::path Relative { Path };
+
+ return Root / Relative;
+}
+
//////////////////////////////////////////////////////////////////////////
std::atomic<int> ChildIdCounter{0};