diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake --- a/libc/cmake/modules/LLVMLibCTestRules.cmake +++ b/libc/cmake/modules/LLVMLibCTestRules.cmake @@ -92,6 +92,9 @@ 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 @@ 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 @@ $<$>:${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/test/CMakeLists.txt b/libc/test/CMakeLists.txt --- a/libc/test/CMakeLists.txt +++ b/libc/test/CMakeLists.txt @@ -13,6 +13,9 @@ 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 --- a/libc/test/UnitTest/CMakeLists.txt +++ b/libc/test/UnitTest/CMakeLists.txt @@ -160,3 +160,9 @@ 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 rename from libc/test/ErrnoSetterMatcher.h rename to libc/test/UnitTest/ErrnoSetterMatcher.h --- 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 - namespace __llvm_libc { namespace testing { @@ -25,29 +26,54 @@ 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) { + __llvm_libc::testing::tlog + << "Expected return value to be: " + << __llvm_libc::fputil::FPBits(ExpectedReturn).str() << '\n'; + __llvm_libc::testing::tlog + << " But got: " + << __llvm_libc::fputil::FPBits(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 --- 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 --- 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 diff --git a/libc/test/src/sched/affinity_test.cpp b/libc/test/src/sched/affinity_test.cpp --- 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 #include diff --git a/libc/test/src/sched/cpu_count_test.cpp b/libc/test/src/sched/cpu_count_test.cpp --- 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 #include diff --git a/libc/test/src/signal/kill_test.cpp b/libc/test/src/signal/kill_test.cpp --- 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 diff --git a/libc/test/src/signal/sigaction_test.cpp b/libc/test/src/signal/sigaction_test.cpp --- 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 diff --git a/libc/test/src/signal/sigaddset_test.cpp b/libc/test/src/signal/sigaddset_test.cpp --- 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 diff --git a/libc/test/src/signal/sigaltstack_test.cpp b/libc/test/src/signal/sigaltstack_test.cpp --- 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 diff --git a/libc/test/src/signal/sigdelset_test.cpp b/libc/test/src/signal/sigdelset_test.cpp --- 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 diff --git a/libc/test/src/signal/sigfillset_test.cpp b/libc/test/src/signal/sigfillset_test.cpp --- 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 diff --git a/libc/test/src/signal/signal_test.cpp b/libc/test/src/signal/signal_test.cpp --- 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 --- 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 --- 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 --- a/libc/test/src/stdlib/CMakeLists.txt +++ b/libc/test/src/stdlib/CMakeLists.txt @@ -9,6 +9,7 @@ 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 --- 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 #include +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 @@ __llvm_libc::fputil::FPBits(uint64_t(0x405ec00000000000)); libc_errno = 0; - double result = __llvm_libc::atof("123"); - - __llvm_libc::fputil::FPBits actual_fp = - __llvm_libc::fputil::FPBits(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(static_cast(expected_fp))); } TEST(LlvmLibcAToFTest, FailedParsingTest) { - __llvm_libc::fputil::FPBits expected_fp = - __llvm_libc::fputil::FPBits(uint64_t(0)); - libc_errno = 0; - double result = __llvm_libc::atof("???"); - - __llvm_libc::fputil::FPBits actual_fp = - __llvm_libc::fputil::FPBits(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(0.0)); } diff --git a/libc/test/src/stdlib/strtod_test.cpp b/libc/test/src/stdlib/strtod_test.cpp --- 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 { public: @@ -46,10 +49,12 @@ libc_errno = 0; double result = __llvm_libc::strtod(inputString, &str_end); - + if (expectedErrno == 0) + EXPECT_THAT(result, Succeeds(static_cast(expected_fp))); + else + EXPECT_THAT(result, Fails(expectedErrno, + static_cast(expected_fp))); EXPECT_EQ(str_end - inputString, expectedStrLen); - EXPECT_FP_EQ(result, static_cast(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 --- 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 diff --git a/libc/test/src/sys/mman/linux/mmap_test.cpp b/libc/test/src/sys/mman/linux/mmap_test.cpp --- 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 diff --git a/libc/test/src/sys/mman/linux/mprotect_test.cpp b/libc/test/src/sys/mman/linux/mprotect_test.cpp --- 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 diff --git a/libc/test/src/sys/mman/linux/posix_madvise_test.cpp b/libc/test/src/sys/mman/linux/posix_madvise_test.cpp --- 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 diff --git a/libc/test/src/sys/random/linux/getrandom_test.cpp b/libc/test/src/sys/random/linux/getrandom_test.cpp --- 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 --- 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 diff --git a/libc/test/src/sys/select/select_failure_test.cpp b/libc/test/src/sys/select/select_failure_test.cpp --- 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 diff --git a/libc/test/src/sys/sendfile/sendfile_test.cpp b/libc/test/src/sys/sendfile/sendfile_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/chmod_test.cpp b/libc/test/src/sys/stat/chmod_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/fchmod_test.cpp b/libc/test/src/sys/stat/fchmod_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/fchmodat_test.cpp b/libc/test/src/sys/stat/fchmodat_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/fstat_test.cpp b/libc/test/src/sys/stat/fstat_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/lstat_test.cpp b/libc/test/src/sys/stat/lstat_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/mkdirat_test.cpp b/libc/test/src/sys/stat/mkdirat_test.cpp --- 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 diff --git a/libc/test/src/sys/stat/stat_test.cpp b/libc/test/src/sys/stat/stat_test.cpp --- 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 diff --git a/libc/test/src/sys/utsname/uname_test.cpp b/libc/test/src/sys/utsname/uname_test.cpp --- 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 diff --git a/libc/test/src/sys/wait/wait4_test.cpp b/libc/test/src/sys/wait/wait4_test.cpp --- 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 diff --git a/libc/test/src/sys/wait/waitpid_test.cpp b/libc/test/src/sys/wait/waitpid_test.cpp --- 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 diff --git a/libc/test/src/termios/termios_test.cpp b/libc/test/src/termios/termios_test.cpp --- 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 diff --git a/libc/test/src/time/difftime_test.cpp b/libc/test/src/time/difftime_test.cpp --- a/libc/test/src/time/difftime_test.cpp +++ b/libc/test/src/time/difftime_test.cpp @@ -9,7 +9,7 @@ #include "src/__support/FPUtil/FPBits.h" #include "src/time/difftime.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 --- 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 --- 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 --- 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 --- 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 --- 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 diff --git a/libc/test/src/unistd/chdir_test.cpp b/libc/test/src/unistd/chdir_test.cpp --- 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 diff --git a/libc/test/src/unistd/dup2_test.cpp b/libc/test/src/unistd/dup2_test.cpp --- 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 --- 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 --- 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 --- 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 diff --git a/libc/test/src/unistd/ftruncate_test.cpp b/libc/test/src/unistd/ftruncate_test.cpp --- 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 --- 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 --- 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 --- 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 --- 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 diff --git a/libc/test/src/unistd/pread_pwrite_test.cpp b/libc/test/src/unistd/pread_pwrite_test.cpp --- 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 --- 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 --- 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 --- 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 diff --git a/libc/test/src/unistd/rmdir_test.cpp b/libc/test/src/unistd/rmdir_test.cpp --- 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 diff --git a/libc/test/src/unistd/symlink_test.cpp b/libc/test/src/unistd/symlink_test.cpp --- 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 --- 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 --- 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 diff --git a/libc/test/src/unistd/truncate_test.cpp b/libc/test/src/unistd/truncate_test.cpp --- 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 --- 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 --- 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) {