stuff-from-scratch/test/test_utils/TestUtils.h

30 lines
612 B
C
Raw Normal View History

2022-12-01 10:52:48 +00:00
#pragma once
2023-12-18 10:16:31 +00:00
//#include "TestDataLocations.h"
2023-01-05 13:16:52 +00:00
2022-12-01 10:52:48 +00:00
#include <filesystem>
using Path = std::filesystem::path;
class TestUtils
{
public:
2023-12-21 09:18:44 +00:00
static Path getTestOutputDir(const String& testFileName = {})
2022-12-01 10:52:48 +00:00
{
2022-12-06 18:02:43 +00:00
if (!testFileName.empty())
{
const auto name = Path(testFileName).filename().stem();
return std::filesystem::current_path() / "test_output" / name;
}
else
{
return std::filesystem::current_path() / "test_output";
}
2022-12-01 10:52:48 +00:00
}
static Path getTestDataDir()
{
2023-01-05 13:16:52 +00:00
return TestDataLocations::getTestDataDir();
2022-12-01 10:52:48 +00:00
}
};