updated build system

This commit is contained in:
2024-10-17 10:20:07 -05:00
parent 39d644e115
commit 63ca3089da
22 changed files with 304 additions and 198 deletions

View File

@@ -29,19 +29,16 @@ static std::vector<std::unique_ptr<repertory::utils::file::i_fs_item>>
static void delete_generated_files() {
repertory::recur_mutex_lock lock{file_mtx};
std::optional<std::string> parent_path;
std::map<std::string, bool> parent_paths;
for (auto &&path : generated_files) {
if (parent_path->empty()) {
parent_path = repertory::utils::path::get_parent_path(path->get_path());
}
[[maybe_unused]] auto removed = path->remove();
parent_paths[repertory::utils::path::get_parent_path(path->get_path())] =
true;
}
generated_files.clear();
if (parent_path.has_value()) {
for (auto &&entry : parent_paths) {
EXPECT_TRUE(
repertory::utils::file::directory(*parent_path).remove_recursively());
repertory::utils::file::directory(entry.first).remove_recursively());
}
}
@@ -49,7 +46,9 @@ struct file_deleter final {
~file_deleter() { delete_generated_files(); }
};
static auto deleter{std::make_unique<file_deleter>()};
static auto deleter{
std::make_unique<file_deleter>(),
};
} // namespace
namespace repertory::test {