2022-05-31 21:26:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2022-10-19 13:41:53 +00:00
|
|
|
namespace Status::Testing
|
|
|
|
{
|
2022-05-31 21:26:41 +00:00
|
|
|
|
2022-10-19 13:41:53 +00:00
|
|
|
class AutoCleanTempTestDir
|
|
|
|
{
|
2022-05-31 21:26:41 +00:00
|
|
|
public:
|
|
|
|
/// Creates a temporary folder to be used in tests. The folder content's will
|
|
|
|
/// be removed when out of scope
|
2022-07-04 21:14:13 +00:00
|
|
|
explicit AutoCleanTempTestDir(const std::string& testName, bool createDir = true);
|
2022-05-31 21:26:41 +00:00
|
|
|
~AutoCleanTempTestDir();
|
|
|
|
|
2022-07-04 21:14:13 +00:00
|
|
|
const std::filesystem::path& tempFolder();
|
2022-05-31 21:26:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const std::filesystem::path m_testFolder;
|
|
|
|
};
|
|
|
|
|
2022-10-19 13:41:53 +00:00
|
|
|
} // namespace Status::Testing
|