mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
a710558c6b
Contains minimal account creation and login Considerations: - migrated status-go wrapper and login code from the fix/cpp-structure (241eec) - Minimal refactoring and changes at the moment. Expect further refactoring follow up to reach the desired state. - Fix missing keychain initialization - Fix accounts DB initialization call done by startup -> Controller.openedAccounts -> status-go.OpenAccounts calls - Small refactoring and todos for other steps - fix SignalsManager - fix async access to dereferenced status-go memory from SignalsManager - fix SignalsManager not starting when registering - finish dev end to end test for create account and login - small improvements and added TODOs for future work - add onboarding test helpers and start messaging test - Refactoring towards Login UI integration Closes: #5909 Closes: #6028
37 lines
900 B
C++
37 lines
900 B
C++
#include "IOTestHelpers.h"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
namespace fs = std::filesystem;
|
|
|
|
namespace Status::Testing {
|
|
|
|
fs::path createTestFolder(const std::string& testName)
|
|
{
|
|
auto t = std::time(nullptr);
|
|
auto tm = *std::localtime(&t);
|
|
std::ostringstream timeOss;
|
|
timeOss << std::put_time(&tm, "%d-%m-%Y_%H-%M-%S");
|
|
return fs::path(testing::TempDir())/"StatusTests"/(testName + "-" + timeOss.str());
|
|
}
|
|
|
|
AutoCleanTempTestDir::AutoCleanTempTestDir(const std::string &testName, bool createDir)
|
|
: m_testFolder(createTestFolder(testName))
|
|
{
|
|
if(createDir)
|
|
fs::create_directories(m_testFolder);
|
|
}
|
|
|
|
AutoCleanTempTestDir::~AutoCleanTempTestDir()
|
|
{
|
|
// TODO: Consider making this concurrent safe and cleanup the root folder as well if empty
|
|
fs::remove_all(m_testFolder);
|
|
}
|
|
|
|
const std::filesystem::path& AutoCleanTempTestDir::tempFolder()
|
|
{
|
|
return m_testFolder;
|
|
}
|
|
|
|
}
|