mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
chore: check exact paths of test executable and provide temp dir
This commit is contained in:
27
test/Catch2Common/OatTestPaths.cpp
Normal file
27
test/Catch2Common/OatTestPaths.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include "OatTestPaths.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace oat::paths
|
||||
{
|
||||
std::filesystem::path GetSourceDirectory()
|
||||
{
|
||||
return fs::current_path() / "src";
|
||||
}
|
||||
|
||||
std::filesystem::path GetTestDirectory()
|
||||
{
|
||||
return fs::current_path() / "test";
|
||||
}
|
||||
|
||||
std::filesystem::path GetTempDirectory()
|
||||
{
|
||||
auto result = fs::current_path() / "build" / ".tmp";
|
||||
if (!fs::is_directory(result))
|
||||
fs::create_directories(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
} // namespace oat::paths
|
Reference in New Issue
Block a user