[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
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem>
// class directory_entry

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,8 +8,6 @@
// UNSUPPORTED: c++03
// XFAIL: LIBCXX-AIX-FIXME
// <filesystem>
// 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();
#endif // defined(__MVS__)
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);
#endif
cmd = "rm -rf " + test_root.string();
ret = std::system(cmd.c_str());