2022-05-31 21:26:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Status::Testing {
|
|
|
|
|
|
|
|
class AutoCleanTempTestDir {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|