summaryrefslogtreecommitdiff
path: root/libc/test/src/unistd/read_write_test.cpp
AgeCommit message (Collapse)Author
2025-03-19[libc] Migrate unistd tests to use ErrnoCheckingTest. (#132067)Alexey Samsonov
Use ErrnoCheckingTest harness added in d039af33096c0a83b03475a240d5e281e2271c44 for all unistd tests that verify errno values. Stop explicitly setting it to zero in test code, as harness does it. It also verifies that the errno is zero at the end of each test case, so update the ASSERT_ERRNO_EQ and ASSERT_ERRNO_FAILURE macro to clear out its value after the verification (similar to how ErrnoSetterMatcher does). Update the CMake and Bazel rules for those tests. In the latter case, remove commented out tests that are currently unsupported in Bazel, since they get stale quickly.
2025-03-14[libc] Fix implicit conversion warnings in tests. (#131362)lntue
2024-02-01[libc] add bazel support for most of unistd (#80078)michaelrj-google
Much of unistd involves modifying files. The tests for these functions need to use libc_make_test_file_path which didn't exist when they were first implemented. This patch adds most of unistd to the bazel along with the corresponding tests. Tests that modify directories had to be disabled since bazel doesn't seem to handle them properly.
2024-01-26[libc][NFC] Use specific ASSERT macros to test errno (#79573)Guillaume Chatelet
This patch provides specific test macros to deal with `errno`. This will help abstract away the differences between unit test and integration/hermetic tests in #79319. In one case we use `libc_errno` which is a struct, in the other case we deal directly with `errno`.
2023-12-13[libc] fix unit tests (#75361)Nick Desaulniers
Fixes #75261
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-05-26[libc] Make ErrnoSetterMatcher handle logging floating point values.Siva Chandra Reddy
Along the way, couple of additional things have been done: 1. Move `ErrnoSetterMatcher.h` to `test/UnitTest` as all other matchers live there now. 2. `ErrnoSetterMatcher` ignores matching `errno` on GPUs. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D151129
2023-04-17[libc][NFC] Remove the unused FDReader testutil.Siva Chandra Reddy
Differential Revision: https://reviews.llvm.org/D148454
2023-03-14[libc][NFC] Switch unistd.h tests to libc_errno.Siva Chandra Reddy
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-01-28[libc][NFC] Create file with all permissions for the user in read_write_test.Siva Chandra Reddy
2022-01-27[libc] Add POSIX close, fsync, open, read and write functions.Siva Chandra Reddy
They are implemented as simple syscall wrappers. The file creation macros have been put in a header file as a temporary solution until we have a cleaner approach to listing platform relevant macros. Reviewed By: abrachet Differential Revision: https://reviews.llvm.org/D118396