diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/refresh.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // The string reported on errors changed, which makes those tests fail when run // against already-released libc++'s. // XFAIL: with_system_cxx_lib=macosx10.15 @@ -66,6 +64,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; @@ -100,6 +101,7 @@ TEST_CHECK(!ent.exists()); } } +#endif void remove_if_exists(const fs::path& p) { std::error_code ec; @@ -128,8 +130,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); @@ -147,10 +151,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; @@ -224,6 +233,7 @@ TEST_CHECK_NO_THROW(ent_sym2); } } +#endif TEST_CASE(refresh_doesnt_throw_on_dne_but_reports_it) { using namespace fs; @@ -271,6 +281,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; @@ -342,5 +355,6 @@ } #undef CHECK_ACCESS } +#endif TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/replace_filename.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class directory_entry @@ -125,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; @@ -167,5 +168,6 @@ TEST_CHECK(ErrorIs(ec, std::errc::permission_denied)); } } +#endif TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_size.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // The string reported on errors changed, which makes those tests fail when run // against already-released libc++'s. // XFAIL: with_system_cxx_lib=macosx10.15 @@ -126,7 +124,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 { @@ -169,6 +169,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; @@ -245,6 +248,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.file_size()); } +#endif } TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/file_type_obs.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class directory_entry @@ -207,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; @@ -269,5 +270,6 @@ TEST_CHECK(CheckEC(sym_status_ec)); } } +#endif TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/hard_link_count.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // The string reported on errors changed, which makes those tests fail when run // against already-released libc++'s. // XFAIL: with_system_cxx_lib=macosx10.15 @@ -129,7 +127,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 { @@ -173,6 +173,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; @@ -250,6 +253,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.hard_link_count()); } +#endif } TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.obs/last_write_time.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // The string reported on errors changed, which makes those tests fail when run // against already-released libc++'s. // XFAIL: with_system_cxx_lib=macosx10.15 @@ -98,7 +96,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 { @@ -141,6 +141,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; @@ -218,6 +221,7 @@ TEST_CHECK(!ec); TEST_CHECK_NO_THROW(ent.last_write_time()); } +#endif } TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp b/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class recursive_directory_iterator @@ -142,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; @@ -492,6 +493,7 @@ } } } +#endif TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // This test requires the dylib support introduced in D92769. // XFAIL: with_system_cxx_lib=macosx10.15 @@ -60,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; @@ -79,6 +79,7 @@ auto st = status(dir); TEST_CHECK(st.permissions() == perms::none); } +#endif TEST_CASE(create_directory_multi_level) { diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -573,6 +573,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; @@ -588,5 +591,6 @@ "last_write_time"); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, last_write_time(file)); } +#endif TEST_SUITE_END() diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove/remove.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // bool remove(const path& p); @@ -62,7 +60,13 @@ permissions(bad_perms_dir, perms::none); const path testCases[] = { non_empty_dir, +#ifndef _WIN32 + // Windows doesn't support setting perms::none on a directory to + // stop it from being accessed. And a fictional file under + // GetWindowsInaccessibleDir() doesn't cause fs::remove() to report + // errors, it just returns false cleanly. file_in_bad_dir, +#endif }; for (auto& p : testCases) { std::error_code ec; diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // uintmax_t remove_all(const path& p); @@ -38,6 +36,10 @@ TEST_CASE(test_error_reporting) { + scoped_test_env env; + // Windows doesn't support setting perms::none to trigger failures + // reading directories. +#ifndef _WIN32 auto checkThrow = [](path const& f, const std::error_code& ec) { #ifndef TEST_HAS_NO_EXCEPTIONS @@ -54,7 +56,6 @@ return true; #endif }; - scoped_test_env env; const path non_empty_dir = env.create_dir("dir"); env.create_file(non_empty_dir / "file1", 42); const path bad_perms_dir = env.create_dir("bad_dir"); @@ -74,6 +75,7 @@ TEST_CHECK(ec); TEST_CHECK(checkThrow(p, ec)); } +#endif // PR#35780 const path testCasesNonexistant[] = { diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.status/status.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // file_status status(const path& p); @@ -56,6 +54,12 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. Imaginary files under GetWindowsInaccessibleDir() +// produce no_such_file_or_directory, not the error codes this test checks +// for. Finally, status() for a too long file name doesn't return errors +// on windows. +#ifndef _WIN32 TEST_CASE(test_status_cannot_resolve) { scoped_test_env env; @@ -98,6 +102,7 @@ #endif } } +#endif TEST_CASE(status_file_types_test) { diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.symlink_status/symlink_status.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // file_status symlink_status(const path& p); @@ -55,6 +53,12 @@ } } +// Windows doesn't support setting perms::none to trigger failures +// reading directories. Imaginary files under GetWindowsInaccessibleDir() +// produce no_such_file_or_directory, not the error codes this test checks +// for. Finally, status() for a too long file name doesn't return errors +// on windows. +#ifndef _WIN32 TEST_CASE(test_symlink_status_cannot_resolve) { scoped_test_env env; @@ -105,6 +109,7 @@ TEST_CHECK(st.permissions() != perms::unknown); } } +#endif TEST_CASE(symlink_status_file_types_test)