diff options
| author | Stefan Boberg <[email protected]> | 2021-06-18 15:43:23 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-06-18 15:43:23 +0200 |
| commit | 9e97f5eef6c89f02f5b0c04886fbc3670e243856 (patch) | |
| tree | 2d21ef998fa6f8ae0b92e2f01085ca25b634f0d6 /zentestutil/zenserverprocess.cpp | |
| parent | Added simple control of test executable exit code (diff) | |
| download | zen-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.cpp | 15 |
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}; |