final TESTING
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
2026-06-13 14:11:42 +07:00
parent c05b1d5f5c
commit 9776e29d7d
24 changed files with 434 additions and 392 deletions

View File

@@ -2,7 +2,9 @@
#include <gtest/gtest.h>
#include <atomic>
#include <filesystem>
#include <unistd.h>
namespace {
@@ -11,8 +13,10 @@ class MissionStoreTest : public ::testing::Test
protected:
void SetUp() override
{
dir_ = std::filesystem::temp_directory_path() / "lm_test_store";
std::filesystem::remove_all(dir_);
static std::atomic<unsigned> seq{0};
dir_ = std::filesystem::temp_directory_path()
/ ("lm_test_" + std::to_string(getpid()) + "_"
+ std::to_string(seq.fetch_add(1)));
std::filesystem::create_directories(dir_);
store_path_ = dir_ / "missions.json";
std::filesystem::copy_file(std::filesystem::path(TEST_FIXTURE_DIR) / "missions.json",
@@ -21,6 +25,12 @@ protected:
store_ = std::make_unique<lm::MissionStore>(store_path_);
}
void TearDown() override
{
std::error_code ec;
std::filesystem::remove_all(dir_, ec);
}
std::filesystem::path dir_;
std::filesystem::path store_path_;
std::unique_ptr<lm::MissionStore> store_;