updated build system
This commit is contained in:
@ -41,7 +41,8 @@ static void delete_generated_files() {
|
||||
generated_files.clear();
|
||||
|
||||
if (parent_path.has_value()) {
|
||||
EXPECT_TRUE(repertory::utils::file::remove_directory(*parent_path, true));
|
||||
EXPECT_TRUE(
|
||||
repertory::utils::file::directory(*parent_path).remove_recursively());
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,8 +111,8 @@ auto get_test_output_dir() -> std::string {
|
||||
auto path = utils::path::combine("/tmp", {temp});
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
if (not utils::file::is_directory(path)) {
|
||||
EXPECT_TRUE(utils::file::create_directories(path));
|
||||
if (not utils::file::directory(path).exists()) {
|
||||
EXPECT_TRUE(utils::file::directory{path}.create_directory());
|
||||
}
|
||||
|
||||
return path;
|
||||
|
@ -29,13 +29,14 @@ namespace repertory {
|
||||
TEST(utils_file, can_create_file) {
|
||||
for (auto idx = 0U; idx < file_type_count; ++idx) {
|
||||
auto path = test::generate_test_file_name("utils_file");
|
||||
EXPECT_FALSE(utils::file::is_file(path) || utils::file::is_directory(path));
|
||||
EXPECT_FALSE(utils::file::file(path).exists() ||
|
||||
utils::file::directory(path).exists());
|
||||
|
||||
auto file = idx == 0U ? utils::file::file::open_or_create_file(path)
|
||||
: utils::file::thread_file::open_or_create_file(path);
|
||||
EXPECT_TRUE(*file);
|
||||
|
||||
EXPECT_TRUE(utils::file::is_file(path));
|
||||
EXPECT_TRUE(utils::file::file(path).exists());
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +76,7 @@ TEST(utils_file, write_fails_for_read_only_file) {
|
||||
auto file = idx == 0U
|
||||
? utils::file::file::open_or_create_file(path, true)
|
||||
: utils::file::thread_file::open_or_create_file(path, true);
|
||||
EXPECT_TRUE(utils::file::is_file(path));
|
||||
EXPECT_TRUE(utils::file::file(path).exists());
|
||||
EXPECT_TRUE(*file);
|
||||
std::size_t bytes_written{};
|
||||
EXPECT_FALSE(file->write(reinterpret_cast<const unsigned char *>("0"), 1U,
|
||||
|
Reference in New Issue
Block a user