[all-commits] [llvm/llvm-project] 2f7ad8: [libc] Migrate unistd tests to use ErrnoCheckingTe...

Alexey Samsonov via All-commits all-commits at lists.llvm.org
Wed Mar 19 13:30:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f7ad891a7bf46aced761354ebe3c932a6ac5471
      https://github.com/llvm/llvm-project/commit/2f7ad891a7bf46aced761354ebe3c932a6ac5471
  Author: Alexey Samsonov <vonosmas at gmail.com>
  Date:   2025-03-19 (Wed, 19 Mar 2025)

  Changed paths:
    M libc/test/UnitTest/Test.h
    M libc/test/src/unistd/CMakeLists.txt
    M libc/test/src/unistd/access_test.cpp
    M libc/test/src/unistd/chdir_test.cpp
    M libc/test/src/unistd/dup2_test.cpp
    M libc/test/src/unistd/dup3_test.cpp
    M libc/test/src/unistd/dup_test.cpp
    M libc/test/src/unistd/fchdir_test.cpp
    M libc/test/src/unistd/fpathconf_test.cpp
    M libc/test/src/unistd/ftruncate_test.cpp
    M libc/test/src/unistd/getentropy_test.cpp
    M libc/test/src/unistd/getsid_test.cpp
    M libc/test/src/unistd/isatty_test.cpp
    M libc/test/src/unistd/link_test.cpp
    M libc/test/src/unistd/linkat_test.cpp
    M libc/test/src/unistd/lseek_test.cpp
    M libc/test/src/unistd/pathconf_test.cpp
    M libc/test/src/unistd/pipe2_test.cpp
    M libc/test/src/unistd/pipe_test.cpp
    M libc/test/src/unistd/pread_pwrite_test.cpp
    M libc/test/src/unistd/read_write_test.cpp
    M libc/test/src/unistd/readlink_test.cpp
    M libc/test/src/unistd/readlinkat_test.cpp
    M libc/test/src/unistd/rmdir_test.cpp
    M libc/test/src/unistd/symlink_test.cpp
    M libc/test/src/unistd/symlinkat_test.cpp
    M libc/test/src/unistd/syscall_test.cpp
    M libc/test/src/unistd/truncate_test.cpp
    M libc/test/src/unistd/unlinkat_test.cpp
    M utils/bazel/llvm-project-overlay/libc/test/src/unistd/BUILD.bazel

  Log Message:
  -----------
  [libc] Migrate unistd tests to use ErrnoCheckingTest. (#132067)

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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list