Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.cons/path.pass.cpp @@ -146,6 +146,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(path_ctor_cannot_resolve) { using namespace fs; scoped_test_env env; @@ -180,5 +183,6 @@ TEST_CHECK_NO_THROW(directory_entry(sym_out_of_dir)); } } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/assign.pass.cpp @@ -97,6 +97,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(test_assign_propagates_error) { using namespace fs; scoped_test_env env; @@ -127,5 +130,6 @@ TEST_CHECK(!ec); } } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp @@ -60,6 +60,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(refresh_on_file_dne) { using namespace fs; scoped_test_env env; @@ -94,6 +97,7 @@ TEST_CHECK(!ent.exists()); } } +#endif void remove_if_exists(const fs::path& p) { std::error_code ec; @@ -122,8 +126,10 @@ LIBCPP_ONLY(permissions(dir, perms::none)); TEST_CHECK(ent.is_symlink()); +#ifndef _WIN32 TEST_CHECK(!ent.is_regular_file()); TEST_CHECK(!ent.exists()); +#endif } permissions(dir, old_perms); env.create_file("dir/file", 101); @@ -141,10 +147,15 @@ TEST_CHECK(!ec); // we don't report bad symlinks as an error. LIBCPP_ONLY(permissions(dir, perms::none)); +#ifndef _WIN32 TEST_CHECK(!ent.exists()); +#endif } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(refresh_cannot_resolve) { using namespace fs; scoped_test_env env; @@ -218,6 +229,7 @@ TEST_CHECK_NO_THROW(ent_sym2); } } +#endif TEST_CASE(refresh_doesnt_throw_on_dne_but_reports_it) { using namespace fs; @@ -265,6 +277,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(access_cache_after_refresh_fails) { using namespace fs; scoped_test_env env; @@ -336,5 +351,6 @@ } #undef CHECK_ACCESS } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp @@ -123,6 +123,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(test_replace_filename_propagates_error) { using namespace fs; scoped_test_env env; @@ -165,5 +168,6 @@ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); } } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp @@ -120,7 +120,9 @@ const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); +#ifndef _WIN32 const perms old_perms = status(dir).permissions(); +#endif // test a file which doesn't exist { @@ -163,6 +165,9 @@ "directory_entry::file_size"); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.file_size()); } + // Windows doesn't support setting perms::none to trigger failures + // reading directories. +#ifndef _WIN32 // test a file w/o appropriate permissions. { directory_entry ent; @@ -239,6 +244,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.file_size()); } +#endif } TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp @@ -205,6 +205,9 @@ } } +#ifndef _WIN32 +// Windows doesn't support setting perms::none to trigger failures +// reading directories. TEST_CASE(test_with_ec_cannot_resolve) { using namespace fs; using fs::directory_entry; @@ -267,5 +270,6 @@ TEST_CHECK(CheckEC(sym_status_ec)); } } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp @@ -123,7 +123,9 @@ const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); +#ifndef _WIN32 const perms old_perms = status(dir).permissions(); +#endif // test a file which doesn't exist { @@ -167,6 +169,9 @@ "directory_entry::hard_link_count"); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.hard_link_count()); } + // Windows doesn't support setting perms::none to trigger failures + // reading directories. +#ifndef _WIN32 // test a file w/o appropriate permissions. { directory_entry ent; @@ -244,6 +249,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.hard_link_count()); } +#endif } TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp @@ -92,7 +92,9 @@ const path sym_out_of_dir = env.create_symlink("dir/file", "sym"); const path sym_in_dir = env.create_symlink("file2", "dir/sym2"); +#ifndef _WIN32 const perms old_perms = status(dir).permissions(); +#endif // test a file which doesn't exist { @@ -135,6 +137,9 @@ "directory_entry::last_write_time"); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ent.last_write_time()); } + // Windows doesn't support setting perms::none to trigger failures + // reading directories. +#ifndef _WIN32 // test a file w/o appropriate permissions. { directory_entry ent; @@ -212,6 +217,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.last_write_time()); } +#endif } TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/ctor.pass.cpp @@ -84,6 +84,9 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(access_denied_test_case) { using namespace fs; @@ -118,6 +121,7 @@ TEST_CHECK(it == directory_iterator{}); } } +#endif TEST_CASE(access_denied_to_file_test_case) Index: libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/ctor.pass.cpp @@ -85,6 +85,9 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(access_denied_test_case) { using namespace fs; @@ -149,6 +152,7 @@ TEST_CHECK(it == RDI{}); } } +#endif TEST_CASE(test_open_on_empty_directory_equals_end) { Index: libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp @@ -140,6 +140,9 @@ TEST_CHECK(it == endIt); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(access_denied_on_recursion_test_case) { using namespace fs; @@ -490,6 +493,7 @@ } } } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp @@ -58,6 +58,8 @@ TEST_CHECK(fs::create_directory(dir, dir2) == false); } +// Windows doesn't have the concept of perms::none on directories. +#ifndef _WIN32 TEST_CASE(create_directory_one_level) { scoped_test_env env; @@ -77,6 +79,7 @@ auto st = status(dir); TEST_CHECK(st.permissions() == perms::none); } +#endif TEST_CASE(create_directory_multi_level) { Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/exists.pass.cpp @@ -71,6 +71,9 @@ TEST_CHECK(!ec); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_exists_fails) { scoped_test_env env; @@ -84,6 +87,7 @@ TEST_CHECK_THROW(filesystem_error, exists(file)); } +#endif TEST_CASE(test_name_too_long) { std::string long_name(2500, 'a'); Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_block_file/is_block_file.pass.cpp @@ -67,6 +67,9 @@ TEST_CHECK(is_block_file(p) == false); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_block_file_fails) { scoped_test_env env; @@ -80,5 +83,6 @@ TEST_CHECK_THROW(filesystem_error, is_block_file(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_char_file/is_character_file.pass.cpp @@ -67,6 +67,9 @@ TEST_CHECK(is_character_file(p) == false); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_character_file_fails) { scoped_test_env env; @@ -80,5 +83,6 @@ TEST_CHECK_THROW(filesystem_error, is_character_file(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_directory/is_directory.pass.cpp @@ -75,6 +75,9 @@ TEST_CHECK(!is_directory(static_env.File)); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_directory_fails) { scoped_test_env env; @@ -88,5 +91,6 @@ TEST_CHECK_THROW(filesystem_error, is_directory(dir2)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_empty/is_empty.pass.cpp @@ -65,6 +65,9 @@ TEST_CHECK(!is_empty(static_env.NonEmptyFile)); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_empty_fails) { scoped_test_env env; @@ -93,7 +96,7 @@ TEST_CHECK_THROW(filesystem_error, is_empty(dir)); } - +#endif #ifndef _WIN32 TEST_CASE(test_fifo_fails) Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_fifo/is_fifo.pass.cpp @@ -67,6 +67,9 @@ TEST_CHECK(is_fifo(p) == false); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_fifo_fails) { scoped_test_env env; @@ -80,5 +83,6 @@ TEST_CHECK_THROW(filesystem_error, is_fifo(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_other/is_other.pass.cpp @@ -67,6 +67,9 @@ TEST_CHECK(is_other(p) == false); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_other_fails) { scoped_test_env env; @@ -80,5 +83,6 @@ TEST_CHECK_THROW(filesystem_error, is_other(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_regular_file/is_regular_file.pass.cpp @@ -70,6 +70,9 @@ TEST_CHECK(ec); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_regular_file_fails) { scoped_test_env env; @@ -83,5 +86,6 @@ TEST_CHECK_THROW(filesystem_error, is_regular_file(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_socket/is_socket.pass.cpp @@ -67,6 +67,9 @@ TEST_CHECK(is_socket(p) == false); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_socket_fails) { scoped_test_env env; @@ -80,5 +83,6 @@ TEST_CHECK_THROW(filesystem_error, is_socket(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.is_symlink/is_symlink.pass.cpp @@ -89,6 +89,9 @@ TEST_CHECK(ec); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_is_symlink_fails) { scoped_test_env env; @@ -102,5 +105,6 @@ TEST_CHECK_THROW(filesystem_error, is_symlink(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -567,6 +567,9 @@ TEST_CHECK(ErrorIs(ec, std::errc::no_such_file_or_directory)); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_exists_fails) { scoped_test_env env; @@ -582,5 +585,6 @@ "last_write_time"); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, last_write_time(file)); } +#endif TEST_SUITE_END() Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp @@ -34,6 +34,9 @@ ASSERT_NOEXCEPT(fs::remove(p, ec)); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_error_reporting) { auto checkThrow = [](path const& f, const std::error_code& ec) @@ -83,6 +86,7 @@ TEST_CHECK(!ec); } } +#endif TEST_CASE(basic_remove_test) { Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp @@ -34,6 +34,9 @@ ASSERT_NOT_NOEXCEPT(fs::remove_all(p, ec)); } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_error_reporting) { auto checkThrow = [](path const& f, const std::error_code& ec) @@ -85,6 +88,7 @@ TEST_CHECK(!ec); } } +#endif TEST_CASE(basic_remove_all_test) { Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp @@ -54,6 +54,9 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_status_cannot_resolve) { scoped_test_env env; @@ -96,6 +99,7 @@ #endif } } +#endif TEST_CASE(status_file_types_test) { Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp @@ -53,6 +53,9 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. +#ifndef _WIN32 TEST_CASE(test_symlink_status_cannot_resolve) { scoped_test_env env; @@ -103,6 +106,7 @@ TEST_CHECK(st.permissions() != perms::unknown); } } +#endif TEST_CASE(symlink_status_file_types_test) Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp @@ -89,12 +89,16 @@ TEST_CHECK(ec); TEST_CHECK(ret == ""); + // Windows doesn't support setting perms::none to trigger failures + // reading directories. +#ifndef _WIN32 // Set the env variable to point to a dir we can't access PutEnv(TC.name, nested_dir); ec = GetTestEC(); ret = temp_directory_path(ec); TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); TEST_CHECK(ret == ""); +#endif // Set the env variable to point to a non-existent dir PutEnv(TC.name, TC.p / "does_not_exist");