diff --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h --- a/libcxx/test/support/filesystem_test_helper.h +++ b/libcxx/test/support/filesystem_test_helper.h @@ -226,10 +226,10 @@ return filename; } - std::string create_symlink(fs::path source_path, - fs::path to_path, - bool sanitize_source = true, - bool is_dir = false) { + std::string create_file_dir_symlink(fs::path source_path, + fs::path to_path, + bool sanitize_source = true, + bool is_dir = false) { std::string source = source_path.string(); std::string to = to_path.string(); if (sanitize_source) @@ -240,6 +240,20 @@ return to; } + std::string create_symlink(fs::path source_path, + fs::path to_path, + bool sanitize_source = true) { + return create_file_dir_symlink(source_path, to_path, sanitize_source, + false); + } + + std::string create_directory_symlink(fs::path source_path, + fs::path to_path, + bool sanitize_source = true) { + return create_file_dir_symlink(source_path, to_path, sanitize_source, + true); + } + std::string create_hardlink(fs::path source_path, fs::path to_path) { std::string source = source_path.string(); std::string to = to_path.string(); @@ -325,12 +339,12 @@ env_.create_dir("dir1/dir2/dir3"); env_.create_file("dir1/dir2/dir3/file5"); env_.create_file("dir1/dir2/file4"); - env_.create_symlink("dir3", "dir1/dir2/symlink_to_dir3", false, true); + env_.create_directory_symlink("dir3", "dir1/dir2/symlink_to_dir3", false); env_.create_file("dir1/file1"); env_.create_file("dir1/file2", 42); env_.create_file("empty_file"); env_.create_file("non_empty_file", 42); - env_.create_symlink("dir1", "symlink_to_dir", false, true); + env_.create_directory_symlink("dir1", "symlink_to_dir", false); env_.create_symlink("empty_file", "symlink_to_empty_file", false); }