status-desktop/libs/StatusQ/tests/TestHelpers/IOTestHelpers.h

25 lines
496 B
C
Raw Normal View History

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