updated build system

This commit is contained in:
2024-08-28 11:00:44 -05:00
parent f0b31aa7b2
commit 82b3efff0c
29 changed files with 358 additions and 188 deletions

View File

@ -33,7 +33,7 @@ static void delete_generated_files() {
for (auto &&path : generated_files) {
if (parent_path->empty()) {
parent_path =
repertory::utils::path::get_parent_directory(path->get_path());
repertory::utils::path::get_parent_path(path->get_path());
}
[[maybe_unused]] auto removed = path->remove();

View File

@ -423,53 +423,53 @@ TEST(utils_path, absolute_can_resolve_path_variables) {
#endif // defined(_WIN32)
}
TEST(utils_path, get_parent_directory) {
TEST(utils_path, get_parent_path) {
#if defined(_WIN32)
{
auto dir = R"(c:\test)";
auto parent = utils::path::get_parent_directory(dir);
auto parent = utils::path::get_parent_path(dir);
EXPECT_STREQ("c:", parent.c_str());
dir = R"(c:\test\file.txt)";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(R"(c:\test)", parent.c_str());
dir = "c:";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ("c:", parent.c_str());
}
{
auto dir = LR"(c:\test)";
auto parent = utils::path::get_parent_directory(dir);
auto parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(L"c:", parent.c_str());
dir = LR"(c:\test\file.txt)";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(LR"(c:\test)", parent.c_str());
dir = L"c:";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(L"c:", parent.c_str());
}
#else // !defined(_WIN32)
{
auto dir = "/test";
auto parent = utils::path::get_parent_directory(dir);
auto parent = utils::path::get_parent_path(dir);
EXPECT_STREQ("/", parent.c_str());
dir = "/test/test";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ("/test", parent.c_str());
}
{
auto dir = L"/test";
auto parent = utils::path::get_parent_directory(dir);
auto parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(L"/", parent.c_str());
dir = L"/test/test";
parent = utils::path::get_parent_directory(dir);
parent = utils::path::get_parent_path(dir);
EXPECT_STREQ(L"/test", parent.c_str());
}
#endif // defined(_WIN32)