aboutsummaryrefslogtreecommitdiff
path: root/zentestutil
diff options
context:
space:
mode:
Diffstat (limited to 'zentestutil')
-rw-r--r--zentestutil/include/zenserverprocess.h1
-rw-r--r--zentestutil/zenserverprocess.cpp15
-rw-r--r--zentestutil/zentestutil.vcxproj2
-rw-r--r--zentestutil/zentestutil.vcxproj.filters2
4 files changed, 17 insertions, 3 deletions
diff --git a/zentestutil/include/zenserverprocess.h b/zentestutil/include/zenserverprocess.h
index 3f86f283c..ecbe39f90 100644
--- a/zentestutil/include/zenserverprocess.h
+++ b/zentestutil/include/zenserverprocess.h
@@ -18,6 +18,7 @@ public:
std::filesystem::path CreateNewTestDir();
std::filesystem::path ProgramBaseDir() const { return m_ProgramBaseDir; }
+ std::filesystem::path RootDir(std::string_view Path);
bool IsInitialized() const { return m_IsInitialized; }
private:
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};
diff --git a/zentestutil/zentestutil.vcxproj b/zentestutil/zentestutil.vcxproj
index cf8b02dc1..6b0656759 100644
--- a/zentestutil/zentestutil.vcxproj
+++ b/zentestutil/zentestutil.vcxproj
@@ -98,7 +98,7 @@
<ClCompile Include="zenserverprocess.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="zenserverprocess.h" />
+ <ClInclude Include="include\zenserverprocess.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/zentestutil/zentestutil.vcxproj.filters b/zentestutil/zentestutil.vcxproj.filters
index 1afefcdf7..ca1414842 100644
--- a/zentestutil/zentestutil.vcxproj.filters
+++ b/zentestutil/zentestutil.vcxproj.filters
@@ -4,6 +4,6 @@
<ClCompile Include="zenserverprocess.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="zenserverprocess.h" />
+ <ClInclude Include="include\zenserverprocess.h" />
</ItemGroup>
</Project> \ No newline at end of file