blob: 636c5f316eb99024eb5db66ec448baea9c952cc5 [file]
add_header_library(
socket_test_support
HDRS
socket_test_support.h
DEPENDS
libc.hdr.sys_socket_macros
libc.hdr.types.size_t
libc.hdr.types.socklen_t
libc.hdr.types.struct_sockaddr_un
libc.src.__support.common
libc.src.__support.CPP.string_view
libc.src.string.strncpy
libc.src.string.strnlen
)
add_custom_target(libc_sys_socket_unittests)
add_libc_unittest(
socket_test
SUITE
libc_sys_socket_unittests
SRCS
socket_test.cpp
DEPENDS
libc.include.sys_socket
libc.src.errno.errno
libc.src.sys.socket.socket
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
bind_test
SUITE
libc_sys_socket_unittests
SRCS
bind_test.cpp
DEPENDS
.socket_test_support
libc.include.sys_socket
libc.hdr.sys_socket_macros
libc.hdr.types.struct_sockaddr_un
libc.src.errno.errno
libc.src.sys.socket.socket
libc.src.sys.socket.bind
libc.src.stdio.remove
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
connect_accept_test
SUITE
libc_sys_socket_unittests
SRCS
connect_accept_test.cpp
DEPENDS
.socket_test_support
libc.include.sys_socket
libc.hdr.fcntl_macros
libc.hdr.sys_socket_macros
libc.hdr.types.size_t
libc.hdr.types.struct_sockaddr_un
libc.src.errno.errno
libc.src.fcntl.fcntl
libc.src.sys.socket.accept
libc.src.sys.socket.accept4
libc.src.sys.socket.bind
libc.src.sys.socket.connect
libc.src.sys.socket.listen
libc.src.sys.socket.socket
libc.src.stdio.remove
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
listen_test
SUITE
libc_sys_socket_unittests
SRCS
listen_test.cpp
DEPENDS
.socket_test_support
libc.include.sys_socket
libc.hdr.sys_socket_macros
libc.hdr.types.struct_sockaddr_un
libc.src.errno.errno
libc.src.sys.socket.socket
libc.src.sys.socket.bind
libc.src.sys.socket.listen
libc.src.stdio.remove
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
socketopt_test
SUITE
libc_sys_socket_unittests
SRCS
socketopt_test.cpp
DEPENDS
libc.include.sys_socket
libc.hdr.sys_socket_macros
libc.hdr.types.socklen_t
libc.hdr.types.struct_linger
libc.src.errno.errno
libc.src.sys.socket.getsockopt
libc.src.sys.socket.setsockopt
libc.src.sys.socket.socket
libc.src.unistd.close
libc.src.unistd.pipe
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
socketpair_test
SUITE
libc_sys_socket_unittests
SRCS
socketpair_test.cpp
DEPENDS
libc.include.sys_socket
libc.src.errno.errno
libc.src.sys.socket.socketpair
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
send_recv_test
SUITE
libc_sys_socket_unittests
SRCS
send_recv_test.cpp
DEPENDS
libc.hdr.sys_socket_macros
libc.src.errno.errno
libc.src.sys.socket.socketpair
libc.src.sys.socket.send
libc.src.sys.socket.recv
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
sendto_recvfrom_test
SUITE
libc_sys_socket_unittests
SRCS
sendto_recvfrom_test.cpp
DEPENDS
libc.include.sys_socket
libc.src.errno.errno
libc.src.sys.socket.socketpair
libc.src.sys.socket.sendto
libc.src.sys.socket.recvfrom
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
sendmsg_recvmsg_test
SUITE
libc_sys_socket_unittests
SRCS
sendmsg_recvmsg_test.cpp
DEPENDS
libc.hdr.fcntl_macros
libc.hdr.sys_socket_macros
libc.hdr.types.struct_cmsghdr
libc.src.errno.errno
libc.src.fcntl.fcntl
libc.src.string.memcpy
libc.src.string.memset
libc.src.sys.socket.getsockopt
libc.src.sys.socket.socketpair
libc.src.sys.socket.sendmsg
libc.src.sys.socket.recvmsg
libc.src.unistd.close
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
shutdown_test
SUITE
libc_sys_socket_unittests
SRCS
shutdown_test.cpp
DEPENDS
libc.include.sys_socket
libc.hdr.sys_socket_macros
libc.hdr.types.ssize_t
libc.src.errno.errno
libc.src.sys.socket.shutdown
libc.src.sys.socket.socketpair
libc.src.unistd.close
libc.src.unistd.read
libc.test.UnitTest.ErrnoCheckingTest
libc.test.UnitTest.ErrnoSetterMatcher
)
add_libc_unittest(
sockaddr_storage_test
SUITE
libc_sys_socket_unittests
SRCS
sockaddr_storage_test.cpp
sockaddr_storage_helper.cpp
DEPENDS
libc.hdr.types.struct_sockaddr_storage
libc.hdr.types.struct_sockaddr_un
)