History log of /llvm-project/libcxx/test/support/filesystem_test_helper.h (Results 1 – 25 of 62)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 2b26ee6e 08-Jan-2025 James Y Knight <jyknight@google.com>

[libcxx] Handle windows system error code mapping in std::error_code. (#93101)

The `std::error_code`/`std::error_category` functionality is designed to
support multiple error domains. On Unix, both

[libcxx] Handle windows system error code mapping in std::error_code. (#93101)

The `std::error_code`/`std::error_category` functionality is designed to
support multiple error domains. On Unix, both system calls and libc
functions return the same error codes, and thus, libc++ today treats
`generic_category()` and `system_category()` as being equivalent.

However, on Windows, libc functions return `errno.h` error codes in the
`errno` global, but system calls return the very different `winerror.h`
error codes via `GetLastError()`.

As such, there is a need to map the winerror.h error codes into generic
errno codes. In libc++, however, the system_error facility does not
implement this mapping; instead the mapping is hidden inside libc++,
used directly by the std::filesystem implementation.

That has a few problems:

1. For std::filesystem APIs, the concrete windows error number is lost,
before users can see it. The intent of the distinction between
std::error_code and std::error_condition is that the error_code return
has the original (potentially more detailed) error code.

2. User-written code which calls Windows system APIs requires this same
mapping, so it also can also return error_code objects that other
(cross-platform) code can understand.

After this commit, an `error_code` with `generic_category()` is used to
report an error from `errno`, and, on Windows only, an `error_code` with
`system_category()` is used to report an error from `GetLastError()`. On
Unix, system_category remains identity-mapped to generic_category, but
is never used by libc++ itself.

The windows error code mapping is moved into system_error, so that
conversion of an `error_code` to `error_condition` correctly translates
the `system_category()` code into a `generic_category()` code, when
appropriate.

This allows code like:
`error_code(GetLastError(), system_category()) == errc::invalid_argument`
to work as expected -- as it does with MSVC STL.

(Continued from old phabricator review [D151493](https://reviews.llvm.org/D151493))

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# c6f3b7bc 06-Nov-2024 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Refactor the configuration macros to being always defined (#112094)

This is a follow-up to #89178. This updates the `<__config_site>`
macros.


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0
# 953af0e7 05-Sep-2024 Louis Dionne <ldionne.2@gmail.com>

[libc++][NFC] Increase consistency for namespace closing comments


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 7918e624 12-Jul-2024 Louis Dionne <ldionne.2@gmail.com>

[libc++] Test suite portability improvements (#98527)

This patch contains a number of small portability improvements for the
test suite, making it easier to run the test suite with other standard

[libc++] Test suite portability improvements (#98527)

This patch contains a number of small portability improvements for the
test suite, making it easier to run the test suite with other standard
library implementations.

- Guard checks for _LIBCPP_HARDENING_MODE to avoid -Wundef
- Avoid defining _LIBCPP_HARDENING_MODE even when no hardening mode is
specified -- we should use the default mode of the library in that case.
- Add missing includes and qualify a few function calls.
- Avoid opening namespace std to forward declare stdlib containers. The
test suite should represent user code, and user code isn't allowed to do
that.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# dc1ae837 12-Jan-2024 Wu Yingcong <yingcong.wu@intel.com>

[libc++][test] Fix a logical mistake introduced by #77058 (#77867)

A logical mistake is made in #77058, we should try to find a new file
path for socket creation when the path's length generated is

[libc++][test] Fix a logical mistake introduced by #77058 (#77867)

A logical mistake is made in #77058, we should try to find a new file
path for socket creation when the path's length generated is bigger than
the socket length limit.

show more ...


# a43e0f90 09-Jan-2024 Wu Yingcong <yingcong.wu@intel.com>

[libc++][test] try to directly create socket file in /tmp when filepath is too long (#77058)

If TMP is set to a folder which path is too long, the current libcxx
test helper function `create_socket

[libc++][test] try to directly create socket file in /tmp when filepath is too long (#77058)

If TMP is set to a folder which path is too long, the current libcxx
test helper function `create_socket()` will fail because of the test
temp folder `test_root`'s path is too long to be used in socket
creation.
In such case, this patch will try to create the socket file directly in
`/tmp` folder.

This patch also add an assertion for `bind()`.

show more ...


# ac8c9f1e 28-Nov-2023 Louis Dionne <ldionne.2@gmail.com>

[libc++] Properly guard std::filesystem with >= C++17 (#72701)

<filesystem> is a C++17 addition. In C++11 and C++14 modes, we actually
have all the code for <filesystem> but it is hidden behind a n

[libc++] Properly guard std::filesystem with >= C++17 (#72701)

<filesystem> is a C++17 addition. In C++11 and C++14 modes, we actually
have all the code for <filesystem> but it is hidden behind a non-inline
namespace __fs so it is not accessible. Instead of doing this unusual
dance, just guard the code for filesystem behind a classic C++17 check
like we normally do.

show more ...


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4
# bce3b505 20-Oct-2023 Ryan Prichard <rprichard@google.com>

[libc++][Android] Mark tests XFAIL/UNSUPPORTED (#69271)

Mark tests as necessary to accommodate Android L (5.0 / API 21) and up.

Add three Android lit features:
- android
- android-device-api=

[libc++][Android] Mark tests XFAIL/UNSUPPORTED (#69271)

Mark tests as necessary to accommodate Android L (5.0 / API 21) and up.

Add three Android lit features:
- android
- android-device-api=(21,22,23,...)
- LIBCXX-ANDROID-FIXME (for failures that need follow-up work)

Enable an AIX workaround in filesystem_test_helper.h for the broken
chmod on older Android devices.

Mark failing test with XFAIL or UNSUPPORTED:
- Mark modules tests as UNSUPPORTED, matching other configurations.
- Mark a gdb test as UNSUPPORTED.
- XFAIL tests for old devices that lack an API (fmemopen).
- XFAIL various FS tests (because SELinux blocks FIFO and hard linking,
because fchmodat is broken on old devices).
- XFAIL various locale tests (because Bionic has limited locale
support). (Also XFAIL an re.traits test.)
- XFAIL some print.fun tests because the error exception has no system
error string.
- Mark std::{cin,wcin} tests UNSUPPORTED because they hang with
adb_run.py on old devices.
- Mark a few tests UNSUPPORTED because they allocate too much memory.
- notify_one.pass.cpp is flaky on Android.
- XFAIL libc++abi demangler test because of Android's special long
double on x86[-64].

N.B. The `__ANDROID_API__` macro specifies a minimum required API level
at build-time, whereas the android-device-api lit feature is the
detected API level of the device at run-time. The android-device-api
value will be >= `__ANDROID_API__`.

This commit was split out from https://reviews.llvm.org/D139147.

Fixes: https://github.com/llvm/llvm-project/issues/69270

show more ...


Revision tags: llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6
# c352fa74 05-Jun-2023 Louis Dionne <ldionne.2@gmail.com>

[libc++] Expand the contents of LIBCXX_ENABLE_FILESYSTEM

Since LIBCXX_ENABLE_FILESYSTEM now truly represents whether the
platform supports a filesystem (as opposed to whether the <filesystem>
librar

[libc++] Expand the contents of LIBCXX_ENABLE_FILESYSTEM

Since LIBCXX_ENABLE_FILESYSTEM now truly represents whether the
platform supports a filesystem (as opposed to whether the <filesystem>
library is provided), we can provide a few additional classes from
the <filesystem> library even when the platform does not have support
for a filesystem. For example, this allows performing path manipulations
using std::filesystem::path even on platforms where there is no actual
filesystem.

rdar://107061236

Differential Revision: https://reviews.llvm.org/D152382

show more ...


Revision tags: llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1
# eb65912e 19-Mar-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Move __errc to __system_error/errc.h

This file was added before we started granularizing the headers, but is essentially just a granularized header. This moves the header to the correct pla

[libc++] Move __errc to __system_error/errc.h

This file was added before we started granularizing the headers, but is essentially just a granularized header. This moves the header to the correct place.

Reviewed By: #libc, EricWF

Spies: libcxx-commits, arichardson, mikhail.ramalho

Differential Revision: https://reviews.llvm.org/D146395

show more ...


# 92fc93e1 24-Mar-2023 Mark de Wever <koraq@xs4all.nl>

[libc++] Qualifies intmax_t and uintmax_t.

This has been done using the following command

find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?intmax_t)|\1std::\2|' \{} \;

Th

[libc++] Qualifies intmax_t and uintmax_t.

This has been done using the following command

find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?intmax_t)|\1std::\2|' \{} \;

The std module doesn't export declarations in the global namespaace.
This is a preparation for that module.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D146821

show more ...


Revision tags: llvmorg-16.0.0
# fb855eb9 14-Mar-2023 Mark de Wever <koraq@xs4all.nl>

[libc++] Qualifies size_t.

This has been done using the following command

find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \;

And manually removed some fals

[libc++] Qualifies size_t.

This has been done using the following command

find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \;

And manually removed some false positives in std/depr/depr.c.headers.

The `std` module doesn't export `::size_t`, this is a preparation for that module.

Reviewed By: ldionne, #libc, EricWF, philnik

Differential Revision: https://reviews.llvm.org/D146088

show more ...


# bd5d0fee 12-Mar-2023 Mark de Wever <koraq@xs4all.nl>

[libc++] Qualifies uint32_t and friends.

This has been done using the following command
find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?int(_[a-z]+)?[0-9]{1,2}_t)|\1std::\

[libc++] Qualifies uint32_t and friends.

This has been done using the following command
find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?int(_[a-z]+)?[0-9]{1,2}_t)|\1std::\2|' \{} \;

And manually removed some false positives in std/depr/depr.c.headers.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D145880

show more ...


Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# 0a4aa8a1 12-Feb-2023 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Granularize <type_traits> includes

Reviewed By: ldionne, #libc, #libc_abi

Spies: #libc_vendors, smeenai, libcxx-commits

Differential Revision: https://reviews.llvm.org/D145320


Revision tags: llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# 2f2ed477 21-Jan-2023 Mark de Wever <koraq@xs4all.nl>

[libc++][test] Removes rapid-cxx-test.h.

Depends on D142808

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D143383


Revision tags: llvmorg-15.0.7
# 6c44ccab 01-Dec-2022 Ryan Prichard <rprichard@google.com>

[libc++] Fix 64-bit file creation for Bionic and Windows

Bionic didn't add fopen64 until API 24, but there's no meaningful
distinction between them with Bionic, so just use fopen instead.

On Window

[libc++] Fix 64-bit file creation for Bionic and Windows

Bionic didn't add fopen64 until API 24, but there's no meaningful
distinction between them with Bionic, so just use fopen instead.

On Windows, use _chsize_s instead of _chsize. _chsize uses a 32-bit
`long` size argument, while _chsize_s uses __int64 instead.

Factor out utils::{off64_t, fopen64, ftruncate64} for use within the
create_file function.

Reviewed By: ldionne, #libc, mstorsjo

Differential Revision: https://reviews.llvm.org/D137132

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3
# 355e0ce3 18-Aug-2022 Louis Dionne <ldionne.2@gmail.com>

[libc++] Extend check for non-ASCII characters to src/, test/ and benchmarks/

Differential Revision: https://reviews.llvm.org/D132180


Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2
# ea4c198a 01-Mar-2022 Martin Storsjö <martin@martin.st>

[libcxx] [test] Make filesystem tests not rely on libc++ internals

As part of https://reviews.llvm.org/D119036
(506cf6dc048835c598b654e43ed8f723a42e39ba), `-DNOMINMAX` was
dropped from the Windows C

[libcxx] [test] Make filesystem tests not rely on libc++ internals

As part of https://reviews.llvm.org/D119036
(506cf6dc048835c598b654e43ed8f723a42e39ba), `-DNOMINMAX` was
dropped from the Windows CI configurations, replaced with a
block with `_LIBCPP_PUSH_MACROS`, `#include <__undef_macros>`
and `_LIBCPP_POP_MACROS` (and
`ADDITIONAL_COMPILE_FLAGS: -DNOMINMAX` left in two tests).

However, this workaround breaks the running the libc++ tests
against a different C++ standard library than libc++, as those
macros and that header are libc++ internals.

Therefore, reinstate `-DNOMINMAX` for clang-cl configurations
and remove the libc++ specific bits in filesystem_test_helper.h.

Differential Revision: https://reviews.llvm.org/D120478

show more ...


Revision tags: llvmorg-14.0.0-rc1
# 506cf6dc 04-Feb-2022 Louis Dionne <ldionne.2@gmail.com>

[libc++] Fix modules and benchmarks CI builds when incomplete features are disabled

Differential Revision: https://reviews.llvm.org/D119036


Revision tags: llvmorg-15-init
# d193f7be 21-Jan-2022 Sean Fertile <sd.fertile@gmail.com>

[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

[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

show more ...


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2
# 43c5e61b 06-Jan-2022 Fanbo Meng <fanbo.meng@ibm.com>

[SystemZ][z/OS][libcxx]:Fix fopen64 undeclared error in 32 bit mode

z/OS doesn't support fopen64() functions. Modify the preprocessor directive for z/OS to use fopen() instead.

Reviewed By: #libc,

[SystemZ][z/OS][libcxx]:Fix fopen64 undeclared error in 32 bit mode

z/OS doesn't support fopen64() functions. Modify the preprocessor directive for z/OS to use fopen() instead.

Reviewed By: #libc, abhina.sreeskantharajan, muiez, ldionne

Differential Revision: https://reviews.llvm.org/D111226

show more ...


# 1d50cf98 23-Dec-2021 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] IWYU in <filesystem> tests

Add headers in `<filesystem>` tests that were transitively included
through `<filesystem>`

Reviewed as part of D116146


# fcc0964e 23-Dec-2021 Nikolas Klauser <nikolasklauser@berlin.de>

Revert "[libc++] Remove unused headers from <filesystem>"

This reverts commit 352945dd36c64fd68b4c73fcc393ee5828da639a.


# 352945dd 22-Dec-2021 Nikolas Klauser <nikolasklauser@berlin.de>

[libc++] Remove unused headers from <filesystem>

Remove unused headers from `<filesystem>`

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D116146


# b8c12af9 13-Dec-2021 Muiez Ahmed <muiez@ibm.com>

[SystemZ][z/OS] Fix handling of dirs with filesystem tests

The aim of this patch is to fix the post processing that is happening on the temporary test directories upon scope exit. In particular, ~sc

[SystemZ][z/OS] Fix handling of dirs with filesystem tests

The aim of this patch is to fix the post processing that is happening on the temporary test directories upon scope exit. In particular, ~scoped_test_env aims to chmod and remove the temporary directories; however,

bad symlinks are followed and we get "No such file or directory". FIX: use find as alternative to chmod and avoid -follow option.
Attempting to remove read-only files on z/OS prompts a message asking for confirmation. FIX: use the -f option to delete read-only files immediately without asking for confirmation.
Some libcxx tests such as libcxx/test/std/input.output/filesystems/cl ass.directory_entry/directory_entry.cons/path.pass.cpp set the dir permissions to none. In turn, recursively doing chmod (-R) does not set the file permissions needed to be able to remove the dir on z/OS only. FIX: use find as alternative to chmod -R, which does not run into this issue on z/OS.

Differential Revision: https://reviews.llvm.org/D108326

show more ...


123