[libc-commits] [libc] 4f1fe19 - [libc] Make ErrnoSetterMatcher handle logging floating point values.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Thu May 25 23:25:01 PDT 2023


Author: Siva Chandra Reddy
Date: 2023-05-26T06:24:51Z
New Revision: 4f1fe19df385445fabde47998affca50c7f1bc1e

URL: https://github.com/llvm/llvm-project/commit/4f1fe19df385445fabde47998affca50c7f1bc1e
DIFF: https://github.com/llvm/llvm-project/commit/4f1fe19df385445fabde47998affca50c7f1bc1e.diff

LOG: [libc] Make ErrnoSetterMatcher handle logging floating point values.

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

Added: 
    libc/test/UnitTest/ErrnoSetterMatcher.h

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake
    libc/include/llvm-libc-macros/generic-error-number-macros.h
    libc/test/CMakeLists.txt
    libc/test/UnitTest/CMakeLists.txt
    libc/test/src/fcntl/creat_test.cpp
    libc/test/src/fcntl/openat_test.cpp
    libc/test/src/sched/affinity_test.cpp
    libc/test/src/sched/cpu_count_test.cpp
    libc/test/src/signal/kill_test.cpp
    libc/test/src/signal/sigaction_test.cpp
    libc/test/src/signal/sigaddset_test.cpp
    libc/test/src/signal/sigaltstack_test.cpp
    libc/test/src/signal/sigdelset_test.cpp
    libc/test/src/signal/sigfillset_test.cpp
    libc/test/src/signal/signal_test.cpp
    libc/test/src/signal/sigprocmask_test.cpp
    libc/test/src/stdio/remove_test.cpp
    libc/test/src/stdlib/CMakeLists.txt
    libc/test/src/stdlib/atof_test.cpp
    libc/test/src/stdlib/strtod_test.cpp
    libc/test/src/sys/mman/linux/madvise_test.cpp
    libc/test/src/sys/mman/linux/mmap_test.cpp
    libc/test/src/sys/mman/linux/mprotect_test.cpp
    libc/test/src/sys/mman/linux/posix_madvise_test.cpp
    libc/test/src/sys/random/linux/getrandom_test.cpp
    libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
    libc/test/src/sys/select/select_failure_test.cpp
    libc/test/src/sys/sendfile/sendfile_test.cpp
    libc/test/src/sys/stat/chmod_test.cpp
    libc/test/src/sys/stat/fchmod_test.cpp
    libc/test/src/sys/stat/fchmodat_test.cpp
    libc/test/src/sys/stat/fstat_test.cpp
    libc/test/src/sys/stat/lstat_test.cpp
    libc/test/src/sys/stat/mkdirat_test.cpp
    libc/test/src/sys/stat/stat_test.cpp
    libc/test/src/sys/utsname/uname_test.cpp
    libc/test/src/sys/wait/wait4_test.cpp
    libc/test/src/sys/wait/waitpid_test.cpp
    libc/test/src/termios/termios_test.cpp
    libc/test/src/time/difftime_test.cpp
    libc/test/src/time/gettimeofday_test.cpp
    libc/test/src/time/gmtime_test.cpp
    libc/test/src/time/mktime_test.cpp
    libc/test/src/time/nanosleep_test.cpp
    libc/test/src/unistd/access_test.cpp
    libc/test/src/unistd/chdir_test.cpp
    libc/test/src/unistd/dup2_test.cpp
    libc/test/src/unistd/dup3_test.cpp
    libc/test/src/unistd/dup_test.cpp
    libc/test/src/unistd/fchdir_test.cpp
    libc/test/src/unistd/ftruncate_test.cpp
    libc/test/src/unistd/isatty_test.cpp
    libc/test/src/unistd/link_test.cpp
    libc/test/src/unistd/linkat_test.cpp
    libc/test/src/unistd/lseek_test.cpp
    libc/test/src/unistd/pread_pwrite_test.cpp
    libc/test/src/unistd/read_write_test.cpp
    libc/test/src/unistd/readlink_test.cpp
    libc/test/src/unistd/readlinkat_test.cpp
    libc/test/src/unistd/rmdir_test.cpp
    libc/test/src/unistd/symlink_test.cpp
    libc/test/src/unistd/symlinkat_test.cpp
    libc/test/src/unistd/syscall_test.cpp
    libc/test/src/unistd/truncate_test.cpp
    libc/test/src/unistd/unlink_test.cpp
    libc/test/src/unistd/unlinkat_test.cpp

Removed: 
    libc/test/ErrnoSetterMatcher.h


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 9c94973a2f921..9b850b963f12f 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -92,6 +92,9 @@ function(create_libc_unittest fq_target_name)
   endif()
 
   get_fq_deps_list(fq_deps_list ${LIBC_UNITTEST_DEPENDS})
+  list(APPEND fq_deps_list libc.src.__support.StringUtil.error_to_string
+                           libc.test.UnitTest.ErrnoSetterMatcher)
+  list(REMOVE_DUPLICATES fq_deps_list)
   get_object_files_for_test(
       link_object_files skipped_entrypoints_list ${fq_deps_list})
   if(skipped_entrypoints_list)
@@ -628,6 +631,7 @@ function(add_libc_hermetic_test test_name)
       libc.src.string.memcpy
       libc.src.string.memmove
       libc.src.string.memset
+      libc.src.__support.StringUtil.error_to_string
   )
   list(REMOVE_DUPLICATES fq_deps_list)
 
@@ -704,6 +708,7 @@ function(add_libc_hermetic_test test_name)
       $<$<NOT:$<BOOL:${LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX}>>:${fq_target_name}.__libc__>)
   add_dependencies(${fq_build_target_name}
                    LibcTest.hermetic
+                   libc.test.UnitTest.ErrnoSetterMatcher
                    ${fq_deps_list})
 
   # Tests on the GPU require an external loader utility to launch the kernel.

diff  --git a/libc/include/llvm-libc-macros/generic-error-number-macros.h b/libc/include/llvm-libc-macros/generic-error-number-macros.h
index e652c6044d034..3805c95cbb2a5 100644
--- a/libc/include/llvm-libc-macros/generic-error-number-macros.h
+++ b/libc/include/llvm-libc-macros/generic-error-number-macros.h
@@ -43,5 +43,6 @@
 #define EPIPE 32
 #define EDOM 33
 #define ERANGE 34
+#define EILSEQ 35
 
 #endif // __LLVM_LIBC_MACROS_GENERIC_ERROR_NUMBER_MACROS_H

diff  --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index 027028de71640..fbe4ba92fdd47 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -13,6 +13,9 @@ add_header_library(
   HDRS
     ErrnoSetterMatcher.h
   DEPENDS
+    libc.src.__support.common
+    libc.src.__support.FPUtil.fp_bits
+    libc.src.__support.StringUtil.error_to_string
     libc.src.errno.errno
 )
 

diff  --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index 52c7845859e37..014e366b80264 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -160,3 +160,9 @@ add_unittest_framework_library(
     libc.src.stdio.scanf_core.core_structs
     libc.test.UnitTest.string_utils
 )
+
+add_header_library(
+  ErrnoSetterMatcher
+  HDRS
+    ErrnoSetterMatcher
+)

diff  --git a/libc/test/ErrnoSetterMatcher.h b/libc/test/UnitTest/ErrnoSetterMatcher.h
similarity index 52%
rename from libc/test/ErrnoSetterMatcher.h
rename to libc/test/UnitTest/ErrnoSetterMatcher.h
index ff117aece3c24..370e8117b82ce 100644
--- a/libc/test/ErrnoSetterMatcher.h
+++ b/libc/test/UnitTest/ErrnoSetterMatcher.h
@@ -9,11 +9,12 @@
 #ifndef LLVM_LIBC_TEST_ERRNOSETTERMATCHER_H
 #define LLVM_LIBC_TEST_ERRNOSETTERMATCHER_H
 
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/StringUtil/error_to_string.h"
+#include "src/__support/macros/properties/architectures.h"
 #include "src/errno/libc_errno.h"
 #include "test/UnitTest/Test.h"
 
-#include <string.h>
-
 namespace __llvm_libc {
 namespace testing {
 
@@ -25,29 +26,54 @@ template <typename T> class ErrnoSetterMatcher : public Matcher<T> {
   int ExpectedErrno;
   int ActualErrno;
 
+  // Even though this is a errno matcher primarily, it has to cater to platforms
+  // which do not have an errno. This predicate checks if errno matching is to
+  // be skipped.
+  static constexpr bool ignore_errno() {
+#ifdef LIBC_TARGET_ARCH_IS_GPU
+    return true;
+#else
+    return false;
+#endif
+  }
+
 public:
   ErrnoSetterMatcher(T ExpectedReturn, int ExpectedErrno)
       : ExpectedReturn(ExpectedReturn), ExpectedErrno(ExpectedErrno) {}
 
   void explainError() override {
-    if (ActualReturn != ExpectedReturn)
-      __llvm_libc::testing::tlog
-          << "Expected return to be " << ExpectedReturn << " but got "
-          << ActualReturn << ".\nExpecte errno to be "
-          << strerror(ExpectedErrno) << " but got " << strerror(ActualErrno)
-          << ".\n";
-    else
-      __llvm_libc::testing::tlog
-          << "Correct value " << ExpectedReturn
-          << " was returned\nBut errno was unexpectely set to "
-          << strerror(ActualErrno) << ".\n";
+    if (ActualReturn != ExpectedReturn) {
+      if constexpr (cpp::is_floating_point_v<T>) {
+        __llvm_libc::testing::tlog
+            << "Expected return value to be: "
+            << __llvm_libc::fputil::FPBits<T>(ExpectedReturn).str() << '\n';
+        __llvm_libc::testing::tlog
+            << "                    But got: "
+            << __llvm_libc::fputil::FPBits<T>(ActualReturn).str() << '\n';
+      } else {
+        __llvm_libc::testing::tlog << "Expected return value to be "
+                                   << ExpectedReturn << " but got "
+                                   << ActualReturn << ".\n";
+      }
+    }
+
+    if constexpr (!ignore_errno()) {
+      if (ActualErrno != ExpectedErrno) {
+        __llvm_libc::testing::tlog
+            << "Expected errno to be \"" << get_error_string(ExpectedErrno)
+            << "\" but got \"" << get_error_string(ActualErrno) << "\".\n";
+      }
+    }
   }
 
   bool match(T Got) {
     ActualReturn = Got;
     ActualErrno = libc_errno;
     libc_errno = 0;
-    return Got == ExpectedReturn && ActualErrno == ExpectedErrno;
+    if constexpr (ignore_errno())
+      return Got == ExpectedReturn;
+    else
+      return Got == ExpectedReturn && ActualErrno == ExpectedErrno;
   }
 };
 

diff  --git a/libc/test/src/fcntl/creat_test.cpp b/libc/test/src/fcntl/creat_test.cpp
index 8a2dd1955b8eb..1b0e8cb43a92f 100644
--- a/libc/test/src/fcntl/creat_test.cpp
+++ b/libc/test/src/fcntl/creat_test.cpp
@@ -10,7 +10,7 @@
 #include "src/fcntl/creat.h"
 #include "src/fcntl/open.h"
 #include "src/unistd/close.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcCreatTest, CreatAndOpen) {

diff  --git a/libc/test/src/fcntl/openat_test.cpp b/libc/test/src/fcntl/openat_test.cpp
index 17626e641d89d..73cce41563b90 100644
--- a/libc/test/src/fcntl/openat_test.cpp
+++ b/libc/test/src/fcntl/openat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/fcntl/openat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/read.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sched/affinity_test.cpp b/libc/test/src/sched/affinity_test.cpp
index b8da2ebf71480..a036647e3ec8e 100644
--- a/libc/test/src/sched/affinity_test.cpp
+++ b/libc/test/src/sched/affinity_test.cpp
@@ -10,7 +10,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/sched/sched_getaffinity.h"
 #include "src/sched/sched_setaffinity.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 
 #include <sched.h>
 #include <sys/syscall.h>

diff  --git a/libc/test/src/sched/cpu_count_test.cpp b/libc/test/src/sched/cpu_count_test.cpp
index e4ad42a881205..92170bf8b6a83 100644
--- a/libc/test/src/sched/cpu_count_test.cpp
+++ b/libc/test/src/sched/cpu_count_test.cpp
@@ -10,7 +10,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/sched/sched_getaffinity.h"
 #include "src/sched/sched_getcpucount.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 
 #include <sched.h>
 #include <sys/syscall.h>

diff  --git a/libc/test/src/signal/kill_test.cpp b/libc/test/src/signal/kill_test.cpp
index 9d04b3aa0d37b..9c53f8e382703 100644
--- a/libc/test/src/signal/kill_test.cpp
+++ b/libc/test/src/signal/kill_test.cpp
@@ -10,7 +10,7 @@
 
 #include "include/sys/syscall.h"          // For syscall numbers.
 #include "src/__support/OSUtil/syscall.h" // For internal syscall function.
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <signal.h>

diff  --git a/libc/test/src/signal/sigaction_test.cpp b/libc/test/src/signal/sigaction_test.cpp
index f8f2940aab549..36160f9a37cef 100644
--- a/libc/test/src/signal/sigaction_test.cpp
+++ b/libc/test/src/signal/sigaction_test.cpp
@@ -9,7 +9,7 @@
 #include "src/signal/raise.h"
 #include "src/signal/sigaction.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/signal/sigaddset_test.cpp b/libc/test/src/signal/sigaddset_test.cpp
index 9ff331084589d..ea5c8c160697c 100644
--- a/libc/test/src/signal/sigaddset_test.cpp
+++ b/libc/test/src/signal/sigaddset_test.cpp
@@ -9,7 +9,7 @@
 #include "include/signal.h"
 #include "src/signal/sigaddset.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/signal/sigaltstack_test.cpp b/libc/test/src/signal/sigaltstack_test.cpp
index 7c92279eaa426..e52b3db59ddb0 100644
--- a/libc/test/src/signal/sigaltstack_test.cpp
+++ b/libc/test/src/signal/sigaltstack_test.cpp
@@ -13,7 +13,7 @@
 #include "src/signal/sigaction.h"
 #include "src/signal/sigaltstack.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <signal.h>

diff  --git a/libc/test/src/signal/sigdelset_test.cpp b/libc/test/src/signal/sigdelset_test.cpp
index 8cb477f33823e..dfaa84d16268f 100644
--- a/libc/test/src/signal/sigdelset_test.cpp
+++ b/libc/test/src/signal/sigdelset_test.cpp
@@ -12,7 +12,7 @@
 #include "src/signal/sigfillset.h"
 #include "src/signal/sigprocmask.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/signal/sigfillset_test.cpp b/libc/test/src/signal/sigfillset_test.cpp
index 9afc0025335f8..6b0e172136f3a 100644
--- a/libc/test/src/signal/sigfillset_test.cpp
+++ b/libc/test/src/signal/sigfillset_test.cpp
@@ -11,7 +11,7 @@
 #include "src/signal/sigfillset.h"
 #include "src/signal/sigprocmask.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/signal/signal_test.cpp b/libc/test/src/signal/signal_test.cpp
index fdf0934dbe7ec..9635e27160249 100644
--- a/libc/test/src/signal/signal_test.cpp
+++ b/libc/test/src/signal/signal_test.cpp
@@ -11,7 +11,7 @@
 #include "src/signal/raise.h"
 #include "src/signal/signal.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 using __llvm_libc::testing::ErrnoSetterMatcher::Fails;

diff  --git a/libc/test/src/signal/sigprocmask_test.cpp b/libc/test/src/signal/sigprocmask_test.cpp
index a36364e0cd5fe..488f1c58ba79f 100644
--- a/libc/test/src/signal/sigprocmask_test.cpp
+++ b/libc/test/src/signal/sigprocmask_test.cpp
@@ -13,7 +13,7 @@
 #include "src/signal/sigemptyset.h"
 #include "src/signal/sigprocmask.h"
 
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 class LlvmLibcSignalTest : public __llvm_libc::testing::Test {

diff  --git a/libc/test/src/stdio/remove_test.cpp b/libc/test/src/stdio/remove_test.cpp
index 3dc05684834e6..dab1c80943f21 100644
--- a/libc/test/src/stdio/remove_test.cpp
+++ b/libc/test/src/stdio/remove_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/mkdirat.h"
 #include "src/unistd/access.h"
 #include "src/unistd/close.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include "src/errno/libc_errno.h"

diff  --git a/libc/test/src/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt
index 01d3257b148db..ad849af59050c 100644
--- a/libc/test/src/stdlib/CMakeLists.txt
+++ b/libc/test/src/stdlib/CMakeLists.txt
@@ -9,6 +9,7 @@ add_libc_test(
   DEPENDS
     libc.src.errno.errno
     libc.src.stdlib.atof
+    libc.test.errno_setter_matcher
 )
 
 add_header_library(

diff  --git a/libc/test/src/stdlib/atof_test.cpp b/libc/test/src/stdlib/atof_test.cpp
index 92d28b3378676..efa9f6c96d365 100644
--- a/libc/test/src/stdlib/atof_test.cpp
+++ b/libc/test/src/stdlib/atof_test.cpp
@@ -10,11 +10,14 @@
 #include "src/errno/libc_errno.h"
 #include "src/stdlib/atof.h"
 
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <limits.h>
 #include <stddef.h>
 
+using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
+
 // This is just a simple test to make sure that this function works at all. It's
 // functionally identical to strtod so the bulk of the testing is there.
 TEST(LlvmLibcAToFTest, SimpleTest) {
@@ -22,31 +25,12 @@ TEST(LlvmLibcAToFTest, SimpleTest) {
       __llvm_libc::fputil::FPBits<double>(uint64_t(0x405ec00000000000));
 
   libc_errno = 0;
-  double result = __llvm_libc::atof("123");
-
-  __llvm_libc::fputil::FPBits<double> actual_fp =
-      __llvm_libc::fputil::FPBits<double>(result);
-
-  EXPECT_EQ(actual_fp.bits, expected_fp.bits);
-  EXPECT_EQ(actual_fp.get_sign(), expected_fp.get_sign());
-  EXPECT_EQ(actual_fp.get_exponent(), expected_fp.get_exponent());
-  EXPECT_EQ(actual_fp.get_mantissa(), expected_fp.get_mantissa());
-  EXPECT_EQ(libc_errno, 0);
+  EXPECT_THAT(__llvm_libc::atof("123"),
+              Succeeds<double>(static_cast<double>(expected_fp)));
 }
 
 TEST(LlvmLibcAToFTest, FailedParsingTest) {
-  __llvm_libc::fputil::FPBits<double> expected_fp =
-      __llvm_libc::fputil::FPBits<double>(uint64_t(0));
-
   libc_errno = 0;
-  double result = __llvm_libc::atof("???");
-
-  __llvm_libc::fputil::FPBits<double> actual_fp =
-      __llvm_libc::fputil::FPBits<double>(result);
-
-  EXPECT_EQ(actual_fp.bits, expected_fp.bits);
-  EXPECT_EQ(actual_fp.get_sign(), expected_fp.get_sign());
-  EXPECT_EQ(actual_fp.get_exponent(), expected_fp.get_exponent());
-  EXPECT_EQ(actual_fp.get_mantissa(), expected_fp.get_mantissa());
-  EXPECT_EQ(libc_errno, 0);
+  // atof does not flag errors.
+  EXPECT_THAT(__llvm_libc::atof("???"), Succeeds<double>(0.0));
 }

diff  --git a/libc/test/src/stdlib/strtod_test.cpp b/libc/test/src/stdlib/strtod_test.cpp
index b2e73ba6e91d3..b775c247f756e 100644
--- a/libc/test/src/stdlib/strtod_test.cpp
+++ b/libc/test/src/stdlib/strtod_test.cpp
@@ -10,7 +10,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/stdlib/strtod.h"
 
-#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/RoundingModeUtils.h"
 #include "test/UnitTest/Test.h"
 
@@ -20,6 +20,9 @@
 using __llvm_libc::fputil::testing::ForceRoundingModeTest;
 using __llvm_libc::fputil::testing::RoundingMode;
 
+using __llvm_libc::testing::ErrnoSetterMatcher::Fails;
+using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
+
 class LlvmLibcStrToDTest : public __llvm_libc::testing::Test,
                            ForceRoundingModeTest<RoundingMode::Nearest> {
 public:
@@ -46,10 +49,12 @@ class LlvmLibcStrToDTest : public __llvm_libc::testing::Test,
 
     libc_errno = 0;
     double result = __llvm_libc::strtod(inputString, &str_end);
-
+    if (expectedErrno == 0)
+      EXPECT_THAT(result, Succeeds<double>(static_cast<double>(expected_fp)));
+    else
+      EXPECT_THAT(result, Fails<double>(expectedErrno,
+                                        static_cast<double>(expected_fp)));
     EXPECT_EQ(str_end - inputString, expectedStrLen);
-    EXPECT_FP_EQ(result, static_cast<double>(expected_fp));
-    EXPECT_EQ(libc_errno, expectedErrno);
   }
 };
 

diff  --git a/libc/test/src/sys/mman/linux/madvise_test.cpp b/libc/test/src/sys/mman/linux/madvise_test.cpp
index dcc6c25b9f1de..4fdb4a2f2fde3 100644
--- a/libc/test/src/sys/mman/linux/madvise_test.cpp
+++ b/libc/test/src/sys/mman/linux/madvise_test.cpp
@@ -10,7 +10,7 @@
 #include "src/sys/mman/madvise.h"
 #include "src/sys/mman/mmap.h"
 #include "src/sys/mman/munmap.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/mman.h>

diff  --git a/libc/test/src/sys/mman/linux/mmap_test.cpp b/libc/test/src/sys/mman/linux/mmap_test.cpp
index 015dad8ad947d..d74701c5e59c9 100644
--- a/libc/test/src/sys/mman/linux/mmap_test.cpp
+++ b/libc/test/src/sys/mman/linux/mmap_test.cpp
@@ -9,7 +9,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/sys/mman/mmap.h"
 #include "src/sys/mman/munmap.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/mman.h>

diff  --git a/libc/test/src/sys/mman/linux/mprotect_test.cpp b/libc/test/src/sys/mman/linux/mprotect_test.cpp
index ea356149a1763..5f2f5f27ce041 100644
--- a/libc/test/src/sys/mman/linux/mprotect_test.cpp
+++ b/libc/test/src/sys/mman/linux/mprotect_test.cpp
@@ -10,7 +10,7 @@
 #include "src/sys/mman/mmap.h"
 #include "src/sys/mman/mprotect.h"
 #include "src/sys/mman/munmap.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <signal.h>

diff  --git a/libc/test/src/sys/mman/linux/posix_madvise_test.cpp b/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
index cd1dbc0e31ed5..b271a7185d000 100644
--- a/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
+++ b/libc/test/src/sys/mman/linux/posix_madvise_test.cpp
@@ -10,7 +10,7 @@
 #include "src/sys/mman/mmap.h"
 #include "src/sys/mman/munmap.h"
 #include "src/sys/mman/posix_madvise.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/mman.h>

diff  --git a/libc/test/src/sys/random/linux/getrandom_test.cpp b/libc/test/src/sys/random/linux/getrandom_test.cpp
index 1d26ee97348bf..839297bc32a61 100644
--- a/libc/test/src/sys/random/linux/getrandom_test.cpp
+++ b/libc/test/src/sys/random/linux/getrandom_test.cpp
@@ -10,7 +10,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/math/fabs.h"
 #include "src/sys/random/getrandom.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcGetRandomTest, InvalidFlag) {

diff  --git a/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp b/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
index aa7a549876aaa..b385cf86ce978 100644
--- a/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
+++ b/libc/test/src/sys/resource/getrlimit_setrlimit_test.cpp
@@ -13,7 +13,7 @@
 #include "src/sys/resource/setrlimit.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/resource.h>

diff  --git a/libc/test/src/sys/select/select_failure_test.cpp b/libc/test/src/sys/select/select_failure_test.cpp
index 242e93ca4cfbc..44d5b2e14c012 100644
--- a/libc/test/src/sys/select/select_failure_test.cpp
+++ b/libc/test/src/sys/select/select_failure_test.cpp
@@ -8,7 +8,7 @@
 
 #include "src/sys/select/select.h"
 #include "src/unistd/read.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/sys/sendfile/sendfile_test.cpp b/libc/test/src/sys/sendfile/sendfile_test.cpp
index e3ed29926d51c..9af01ad633747 100644
--- a/libc/test/src/sys/sendfile/sendfile_test.cpp
+++ b/libc/test/src/sys/sendfile/sendfile_test.cpp
@@ -14,7 +14,7 @@
 #include "src/unistd/read.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/chmod_test.cpp b/libc/test/src/sys/stat/chmod_test.cpp
index 55e68bcabfa40..f12d20dedf489 100644
--- a/libc/test/src/sys/stat/chmod_test.cpp
+++ b/libc/test/src/sys/stat/chmod_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/chmod.h"
 #include "src/unistd/close.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/fchmod_test.cpp b/libc/test/src/sys/stat/fchmod_test.cpp
index 9dc033f8169d0..0a6c9f4a4509b 100644
--- a/libc/test/src/sys/stat/fchmod_test.cpp
+++ b/libc/test/src/sys/stat/fchmod_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/fchmod.h"
 #include "src/unistd/close.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/fchmodat_test.cpp b/libc/test/src/sys/stat/fchmodat_test.cpp
index 68a3ef398cca6..578d0b0f1dfa6 100644
--- a/libc/test/src/sys/stat/fchmodat_test.cpp
+++ b/libc/test/src/sys/stat/fchmodat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/fchmodat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/fstat_test.cpp b/libc/test/src/sys/stat/fstat_test.cpp
index 6105046a69fe0..8220181e03bd5 100644
--- a/libc/test/src/sys/stat/fstat_test.cpp
+++ b/libc/test/src/sys/stat/fstat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/fstat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/lstat_test.cpp b/libc/test/src/sys/stat/lstat_test.cpp
index ae8ea600a36ab..a3edae192d280 100644
--- a/libc/test/src/sys/stat/lstat_test.cpp
+++ b/libc/test/src/sys/stat/lstat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/lstat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/mkdirat_test.cpp b/libc/test/src/sys/stat/mkdirat_test.cpp
index 30fbd9782df45..584f6eb18251a 100644
--- a/libc/test/src/sys/stat/mkdirat_test.cpp
+++ b/libc/test/src/sys/stat/mkdirat_test.cpp
@@ -8,7 +8,7 @@
 
 #include "src/sys/stat/mkdirat.h"
 #include "src/unistd/rmdir.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/stat/stat_test.cpp b/libc/test/src/sys/stat/stat_test.cpp
index 97cb559316e92..dd9bb1cbe3171 100644
--- a/libc/test/src/sys/stat/stat_test.cpp
+++ b/libc/test/src/sys/stat/stat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/sys/stat/stat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/sys/utsname/uname_test.cpp b/libc/test/src/sys/utsname/uname_test.cpp
index 8f1c1c988afeb..58d7db797a621 100644
--- a/libc/test/src/sys/utsname/uname_test.cpp
+++ b/libc/test/src/sys/utsname/uname_test.cpp
@@ -9,7 +9,7 @@
 #include "src/__support/CPP/string_view.h"
 #include "src/__support/macros/properties/architectures.h"
 #include "src/sys/utsname/uname.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/sys/wait/wait4_test.cpp b/libc/test/src/sys/wait/wait4_test.cpp
index 7464ee02a812a..a7ea9ee25d7ce 100644
--- a/libc/test/src/sys/wait/wait4_test.cpp
+++ b/libc/test/src/sys/wait/wait4_test.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/sys/wait/wait4.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/sys/wait/waitpid_test.cpp b/libc/test/src/sys/wait/waitpid_test.cpp
index 136946c4e0fe3..64441e70ec428 100644
--- a/libc/test/src/sys/wait/waitpid_test.cpp
+++ b/libc/test/src/sys/wait/waitpid_test.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/sys/wait/waitpid.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <errno.h>

diff  --git a/libc/test/src/termios/termios_test.cpp b/libc/test/src/termios/termios_test.cpp
index 7c2d219abb91e..01a78c24de383 100644
--- a/libc/test/src/termios/termios_test.cpp
+++ b/libc/test/src/termios/termios_test.cpp
@@ -16,7 +16,7 @@
 #include "src/termios/tcgetsid.h"
 #include "src/termios/tcsetattr.h"
 #include "src/unistd/close.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <termios.h>

diff  --git a/libc/test/src/time/
diff time_test.cpp b/libc/test/src/time/
diff time_test.cpp
index f099d5899c53b..dc22494114dfd 100644
--- a/libc/test/src/time/
diff time_test.cpp
+++ b/libc/test/src/time/
diff time_test.cpp
@@ -9,7 +9,7 @@
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/time/
diff time.h"
 #include "src/time/time_utils.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;

diff  --git a/libc/test/src/time/gettimeofday_test.cpp b/libc/test/src/time/gettimeofday_test.cpp
index f6a021b56f826..5edd61c648369 100644
--- a/libc/test/src/time/gettimeofday_test.cpp
+++ b/libc/test/src/time/gettimeofday_test.cpp
@@ -10,7 +10,7 @@
 
 #include "src/time/gettimeofday.h"
 #include "src/time/nanosleep.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 namespace cpp = __llvm_libc::cpp;

diff  --git a/libc/test/src/time/gmtime_test.cpp b/libc/test/src/time/gmtime_test.cpp
index 12bc16d4ed5da..07e3950bdcf24 100644
--- a/libc/test/src/time/gmtime_test.cpp
+++ b/libc/test/src/time/gmtime_test.cpp
@@ -9,7 +9,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/time/gmtime.h"
 #include "src/time/time_utils.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 #include "test/src/time/TmMatcher.h"
 

diff  --git a/libc/test/src/time/mktime_test.cpp b/libc/test/src/time/mktime_test.cpp
index 03b0d50a44e4a..21910cffc376f 100644
--- a/libc/test/src/time/mktime_test.cpp
+++ b/libc/test/src/time/mktime_test.cpp
@@ -8,7 +8,7 @@
 
 #include "src/time/mktime.h"
 #include "src/time/time_utils.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 #include "test/src/time/TmHelper.h"
 #include "test/src/time/TmMatcher.h"

diff  --git a/libc/test/src/time/nanosleep_test.cpp b/libc/test/src/time/nanosleep_test.cpp
index b66a7e898056b..e89d4fdfc0576 100644
--- a/libc/test/src/time/nanosleep_test.cpp
+++ b/libc/test/src/time/nanosleep_test.cpp
@@ -10,7 +10,7 @@
 
 #include "src/errno/libc_errno.h"
 #include "src/time/nanosleep.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 namespace cpp = __llvm_libc::cpp;

diff  --git a/libc/test/src/unistd/access_test.cpp b/libc/test/src/unistd/access_test.cpp
index 24e4943312842..f0fa9de8e6256 100644
--- a/libc/test/src/unistd/access_test.cpp
+++ b/libc/test/src/unistd/access_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/access.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <unistd.h>

diff  --git a/libc/test/src/unistd/chdir_test.cpp b/libc/test/src/unistd/chdir_test.cpp
index de64f6e76317d..a19fb29c6ebab 100644
--- a/libc/test/src/unistd/chdir_test.cpp
+++ b/libc/test/src/unistd/chdir_test.cpp
@@ -10,7 +10,7 @@
 #include "src/fcntl/open.h"
 #include "src/unistd/chdir.h"
 #include "src/unistd/close.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/unistd/dup2_test.cpp b/libc/test/src/unistd/dup2_test.cpp
index 1a5ff0f570345..bde5b9605e6aa 100644
--- a/libc/test/src/unistd/dup2_test.cpp
+++ b/libc/test/src/unistd/dup2_test.cpp
@@ -13,7 +13,7 @@
 #include "src/unistd/read.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcdupTest, ReadAndWriteViaDup) {

diff  --git a/libc/test/src/unistd/dup3_test.cpp b/libc/test/src/unistd/dup3_test.cpp
index 75825bc0ec4ed..11a540c44706a 100644
--- a/libc/test/src/unistd/dup3_test.cpp
+++ b/libc/test/src/unistd/dup3_test.cpp
@@ -13,7 +13,7 @@
 #include "src/unistd/read.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 // The tests here are exactly the same as those of dup2. We only test the

diff  --git a/libc/test/src/unistd/dup_test.cpp b/libc/test/src/unistd/dup_test.cpp
index 5d8c9b9b340e8..9a0f8056b8ae8 100644
--- a/libc/test/src/unistd/dup_test.cpp
+++ b/libc/test/src/unistd/dup_test.cpp
@@ -13,7 +13,7 @@
 #include "src/unistd/read.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcdupTest, ReadAndWriteViaDup) {

diff  --git a/libc/test/src/unistd/fchdir_test.cpp b/libc/test/src/unistd/fchdir_test.cpp
index f004af91d2cb6..3e04acd7f4213 100644
--- a/libc/test/src/unistd/fchdir_test.cpp
+++ b/libc/test/src/unistd/fchdir_test.cpp
@@ -10,7 +10,7 @@
 #include "src/fcntl/open.h"
 #include "src/unistd/close.h"
 #include "src/unistd/fchdir.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/unistd/ftruncate_test.cpp b/libc/test/src/unistd/ftruncate_test.cpp
index 0814ef3862618..217ab95f1fedb 100644
--- a/libc/test/src/unistd/ftruncate_test.cpp
+++ b/libc/test/src/unistd/ftruncate_test.cpp
@@ -14,7 +14,7 @@
 #include "src/unistd/read.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 namespace cpp = __llvm_libc::cpp;

diff  --git a/libc/test/src/unistd/isatty_test.cpp b/libc/test/src/unistd/isatty_test.cpp
index c910e360192d4..538101d3567da 100644
--- a/libc/test/src/unistd/isatty_test.cpp
+++ b/libc/test/src/unistd/isatty_test.cpp
@@ -10,7 +10,7 @@
 #include "src/fcntl/open.h"
 #include "src/unistd/close.h"
 #include "src/unistd/isatty.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 using __llvm_libc::testing::ErrnoSetterMatcher::Fails;

diff  --git a/libc/test/src/unistd/link_test.cpp b/libc/test/src/unistd/link_test.cpp
index ef98559877e0f..7acb9dc86a054 100644
--- a/libc/test/src/unistd/link_test.cpp
+++ b/libc/test/src/unistd/link_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/close.h"
 #include "src/unistd/link.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcLinkTest, CreateAndUnlink) {

diff  --git a/libc/test/src/unistd/linkat_test.cpp b/libc/test/src/unistd/linkat_test.cpp
index e61c7c17a80f2..dcb6bff594a78 100644
--- a/libc/test/src/unistd/linkat_test.cpp
+++ b/libc/test/src/unistd/linkat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/close.h"
 #include "src/unistd/linkat.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcLinkatTest, CreateAndUnlink) {

diff  --git a/libc/test/src/unistd/lseek_test.cpp b/libc/test/src/unistd/lseek_test.cpp
index 07cd89551a63f..cb04db462e414 100644
--- a/libc/test/src/unistd/lseek_test.cpp
+++ b/libc/test/src/unistd/lseek_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/close.h"
 #include "src/unistd/lseek.h"
 #include "src/unistd/read.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <unistd.h>

diff  --git a/libc/test/src/unistd/pread_pwrite_test.cpp b/libc/test/src/unistd/pread_pwrite_test.cpp
index 9da4cf98d390e..4d0158a8173a0 100644
--- a/libc/test/src/unistd/pread_pwrite_test.cpp
+++ b/libc/test/src/unistd/pread_pwrite_test.cpp
@@ -14,7 +14,7 @@
 #include "src/unistd/pwrite.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcUniStd, PWriteAndPReadBackTest) {

diff  --git a/libc/test/src/unistd/read_write_test.cpp b/libc/test/src/unistd/read_write_test.cpp
index 6e6887fd925bf..ed819a93d5f82 100644
--- a/libc/test/src/unistd/read_write_test.cpp
+++ b/libc/test/src/unistd/read_write_test.cpp
@@ -12,7 +12,7 @@
 #include "src/unistd/fsync.h"
 #include "src/unistd/read.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcUniStd, WriteAndReadBackTest) {

diff  --git a/libc/test/src/unistd/readlink_test.cpp b/libc/test/src/unistd/readlink_test.cpp
index ab9223fffcd80..dbb957f29fd05 100644
--- a/libc/test/src/unistd/readlink_test.cpp
+++ b/libc/test/src/unistd/readlink_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/readlink.h"
 #include "src/unistd/symlink.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 namespace cpp = __llvm_libc::cpp;

diff  --git a/libc/test/src/unistd/readlinkat_test.cpp b/libc/test/src/unistd/readlinkat_test.cpp
index eb23f2ee85b6f..39127c0288b0b 100644
--- a/libc/test/src/unistd/readlinkat_test.cpp
+++ b/libc/test/src/unistd/readlinkat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/readlinkat.h"
 #include "src/unistd/symlink.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/unistd/rmdir_test.cpp b/libc/test/src/unistd/rmdir_test.cpp
index 55e2c261704b4..3fcf328b67d98 100644
--- a/libc/test/src/unistd/rmdir_test.cpp
+++ b/libc/test/src/unistd/rmdir_test.cpp
@@ -9,7 +9,7 @@
 #include "src/errno/libc_errno.h"
 #include "src/sys/stat/mkdir.h"
 #include "src/unistd/rmdir.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/unistd/symlink_test.cpp b/libc/test/src/unistd/symlink_test.cpp
index 44821e720b875..7017d4bb4f941 100644
--- a/libc/test/src/unistd/symlink_test.cpp
+++ b/libc/test/src/unistd/symlink_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/close.h"
 #include "src/unistd/symlink.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcSymlinkTest, CreateAndUnlink) {

diff  --git a/libc/test/src/unistd/symlinkat_test.cpp b/libc/test/src/unistd/symlinkat_test.cpp
index 847bbbf5d5301..e629c14f0f7a1 100644
--- a/libc/test/src/unistd/symlinkat_test.cpp
+++ b/libc/test/src/unistd/symlinkat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/unistd/close.h"
 #include "src/unistd/symlinkat.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcSymlinkatTest, CreateAndUnlink) {

diff  --git a/libc/test/src/unistd/syscall_test.cpp b/libc/test/src/unistd/syscall_test.cpp
index 5086996988d5a..03b9a547cdcb7 100644
--- a/libc/test/src/unistd/syscall_test.cpp
+++ b/libc/test/src/unistd/syscall_test.cpp
@@ -8,7 +8,7 @@
 
 #include "src/errno/libc_errno.h"
 #include "src/unistd/syscall.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 #include <fcntl.h>

diff  --git a/libc/test/src/unistd/truncate_test.cpp b/libc/test/src/unistd/truncate_test.cpp
index 85047d2899305..4885a12225854 100644
--- a/libc/test/src/unistd/truncate_test.cpp
+++ b/libc/test/src/unistd/truncate_test.cpp
@@ -14,7 +14,7 @@
 #include "src/unistd/truncate.h"
 #include "src/unistd/unlink.h"
 #include "src/unistd/write.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 namespace cpp = __llvm_libc::cpp;

diff  --git a/libc/test/src/unistd/unlink_test.cpp b/libc/test/src/unistd/unlink_test.cpp
index 515378ff4fa7b..ff55123fa0a4e 100644
--- a/libc/test/src/unistd/unlink_test.cpp
+++ b/libc/test/src/unistd/unlink_test.cpp
@@ -10,7 +10,7 @@
 #include "src/fcntl/open.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlink.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcUnlinkTest, CreateAndUnlink) {

diff  --git a/libc/test/src/unistd/unlinkat_test.cpp b/libc/test/src/unistd/unlinkat_test.cpp
index 24c14bf8720ac..ecb9d3a771392 100644
--- a/libc/test/src/unistd/unlinkat_test.cpp
+++ b/libc/test/src/unistd/unlinkat_test.cpp
@@ -11,7 +11,7 @@
 #include "src/fcntl/openat.h"
 #include "src/unistd/close.h"
 #include "src/unistd/unlinkat.h"
-#include "test/ErrnoSetterMatcher.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
 TEST(LlvmLibcUnlinkatTest, CreateAndDeleteTest) {


        


More information about the libc-commits mailing list