[libc][obvious] Move ErrnoSetterMatcher to test/ErrnoSetterMetcher.h.

This commit is contained in:
Siva Chandra Reddy 2020-07-28 10:57:00 -07:00
parent a5b89c2853
commit acca2980a3
14 changed files with 27 additions and 18 deletions

View File

@ -1,3 +1,9 @@
add_header_library(
errno_setter_matcher
HDRS
ErrnoSetterMatcher.h
)
add_custom_target(check-libc)
add_subdirectory(config)

View File

@ -6,15 +6,11 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_UTILS_UNITTEST_ERRNOSETTERMATCHER_H
#define LLVM_LIBC_UTILS_UNITTEST_ERRNOSETTERMATCHER_H
#ifndef LLVM_LIBC_TEST_ERRNOSETTERMATCHER_H
#define LLVM_LIBC_TEST_ERRNOSETTERMATCHER_H
#include "Test.h"
// Using LLVM libc headers in UnitTest is not ideal however we also want the
// test/ directory to have the same layout as libc/ so there is no clean place
// to put this file except for in utils/UnitTest/.
#include "src/errno/llvmlibc_errno.h"
#include "utils/UnitTest/Test.h"
namespace __llvm_libc {
namespace testing {
@ -73,4 +69,4 @@ static internal::ErrnoSetterMatcher<RetT> Fails(int ExpectedErrno,
} // namespace testing
} // namespace __llvm_libc
#endif // LLVM_LIBC_UTILS_UNITTEST_ERRNOSETTERMATCHER_H
#endif // LLVM_LIBC_TEST_ERRNOSETTERMATCHER_H

View File

@ -22,6 +22,7 @@ add_libc_unittest(
libc.include.signal
libc.src.signal.raise
libc.src.signal.sigaction
libc.test.errno_setter_matcher
)
add_libc_unittest(
@ -37,6 +38,7 @@ add_libc_unittest(
libc.src.signal.sigaddset
libc.src.signal.sigemptyset
libc.src.signal.sigprocmask
libc.test.errno_setter_matcher
)
add_libc_unittest(
@ -49,6 +51,7 @@ add_libc_unittest(
libc.include.errno
libc.include.signal
libc.src.signal.sigaddset
libc.test.errno_setter_matcher
)
add_libc_unittest(
@ -63,6 +66,7 @@ add_libc_unittest(
libc.src.errno.__errno_location
libc.src.signal.raise
libc.src.signal.signal
libc.test.errno_setter_matcher
)
add_libc_unittest(
@ -77,6 +81,7 @@ add_libc_unittest(
libc.src.signal.raise
libc.src.signal.sigfillset
libc.src.signal.sigprocmask
libc.test.errno_setter_matcher
)
add_libc_unittest(
@ -92,4 +97,5 @@ add_libc_unittest(
libc.src.signal.sigdelset
libc.src.signal.sigfillset
libc.src.signal.sigprocmask
libc.test.errno_setter_matcher
)

View File

@ -12,7 +12,7 @@
#include "src/signal/raise.h"
#include "src/signal/sigaction.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;

View File

@ -10,7 +10,7 @@
#include "include/signal.h"
#include "src/signal/sigaddset.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
// This tests invalid inputs and ensures errno is properly set.

View File

@ -13,7 +13,7 @@
#include "src/signal/sigfillset.h"
#include "src/signal/sigprocmask.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
TEST(Sigdelset, Invalid) {

View File

@ -12,7 +12,7 @@
#include "src/signal/sigfillset.h"
#include "src/signal/sigprocmask.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
TEST(Sigfillset, Invalid) {

View File

@ -12,7 +12,7 @@
#include "src/signal/raise.h"
#include "src/signal/signal.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;

View File

@ -14,7 +14,7 @@
#include "src/signal/sigemptyset.h"
#include "src/signal/sigprocmask.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
class SignalTest : public __llvm_libc::testing::Test {

View File

@ -12,4 +12,5 @@ add_libc_unittest(
libc.src.errno.__errno_location
libc.src.sys.mman.mmap
libc.src.sys.mman.munmap
libc.test.errno_setter_matcher
)

View File

@ -11,7 +11,7 @@
#include "src/errno/llvmlibc_errno.h"
#include "src/sys/mman/mmap.h"
#include "src/sys/mman/munmap.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
using __llvm_libc::testing::ErrnoSetterMatcher::Fails;

View File

@ -7,7 +7,8 @@ add_libc_unittest(
SRCS
write_test.cpp
DEPENDS
libc.src.unistd.write
libc.include.errno
libc.include.unistd
libc.src.unistd.write
libc.test.errno_setter_matcher
)

View File

@ -8,7 +8,7 @@
#include "include/errno.h"
#include "src/unistd/write.h"
#include "utils/UnitTest/ErrnoSetterMatcher.h"
#include "test/ErrnoSetterMatcher.h"
#include "utils/UnitTest/Test.h"
#include "utils/testutils/FDReader.h"

View File

@ -2,7 +2,6 @@ add_llvm_library(
LibcUnitTest
Test.cpp
Test.h
ErrnoSetterMatcher.h
LINK_COMPONENTS Support
)
target_include_directories(LibcUnitTest PUBLIC ${LIBC_SOURCE_DIR})