[libc++][AIX] Do not assert chmod return value is non-zero.

A number of the filesystem tests create a directory that contains a bad
symlink. On AIX recursively setting permissions on said directory will
return a non-zero value because of the bad symlink, however the
following rm -r still completes successfully. Avoid the assertion on
AIX, and rely on the return value of the remove command to detect
problems.

Differential Revision: https://reviews.llvm.org/D112086
This commit is contained in:
Sean Fertile 2022-01-21 11:05:31 -05:00
parent 2d9ed1aba2
commit d193f7be78
54 changed files with 6 additions and 106 deletions

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_entry // class directory_entry

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// The string reported on errors changed, which makes those tests fail when run // The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s. // against already-released libc++'s.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_entry // class directory_entry

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// The string reported on errors changed, which makes those tests fail when run // The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s. // against already-released libc++'s.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_entry // class directory_entry

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// The string reported on errors changed, which makes those tests fail when run // The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s. // against already-released libc++'s.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// The string reported on errors changed, which makes those tests fail when run // The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s. // against already-released libc++'s.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_entry // class directory_entry

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_entry // class directory_entry

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class directory_iterator // class directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// class recursive_directory_iterator // class recursive_directory_iterator

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// path canonical(const path& p); // path canonical(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// void copy(const path& from, const path& to); // void copy(const path& from, const path& to);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// This test requires the dylib support introduced in D92769. // This test requires the dylib support introduced in D92769.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// This test requires the dylib support introduced in D92769. // This test requires the dylib support introduced in D92769.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// path current_path(); // path current_path();

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool equivalent(path const& lhs, path const& rhs); // bool equivalent(path const& lhs, path const& rhs);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool exists(file_status s) noexcept // bool exists(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// The string reported on errors changed, which makes those tests fail when run // The string reported on errors changed, which makes those tests fail when run
// against already-released libc++'s. // against already-released libc++'s.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.15

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// uintmax_t hard_link_count(const path& p); // uintmax_t hard_link_count(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_block_file(file_status s) noexcept // bool is_block_file(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_character_file(file_status s) noexcept // bool is_character_file(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_directory(file_status s) noexcept // bool is_directory(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_empty(path const& p); // bool is_empty(path const& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_fifo(file_status s) noexcept // bool is_fifo(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_other(file_status s) noexcept // bool is_other(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_regular_file(file_status s) noexcept // bool is_regular_file(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_socket(file_status s) noexcept // bool is_socket(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// bool is_symlink(file_status s) noexcept // bool is_symlink(file_status s) noexcept

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// path read_symlink(const path& p); // path read_symlink(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// path proximate(const path& p, error_code &ec) // path proximate(const path& p, error_code &ec)

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// void rename(const path& old_p, const path& new_p); // void rename(const path& old_p, const path& new_p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// void resize_file(const path& p, uintmax_t new_size); // void resize_file(const path& p, uintmax_t new_size);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// space_info space(const path& p); // space_info space(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// file_status status(const path& p); // file_status status(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// file_status symlink_status(const path& p); // file_status symlink_status(const path& p);

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03 // UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem> // <filesystem>
// path weakly_canonical(const path& p); // path weakly_canonical(const path& p);

View File

@ -148,7 +148,13 @@ struct scoped_test_env
std::string cmd = "chmod -R 777 " + test_root.string(); std::string cmd = "chmod -R 777 " + test_root.string();
#endif // defined(__MVS__) #endif // defined(__MVS__)
int ret = std::system(cmd.c_str()); int ret = std::system(cmd.c_str());
#if !defined(_AIX)
// On AIX the chmod command will return non-zero when trying to set
// the permissions on a directory that contains a bad symlink. This triggers
// the assert, despite being able to delete everything with the following
// `rm -r` command.
assert(ret == 0); assert(ret == 0);
#endif
cmd = "rm -rf " + test_root.string(); cmd = "rm -rf " + test_root.string();
ret = std::system(cmd.c_str()); ret = std::system(cmd.c_str());