Expand BSD sockets poll tests and remove legacy-poll code (#7414)

* Move integ test to corredt place and re-enable tests

* Depend on `poll.h` (removes support for non-POSIX systems)

* Only build tests for each arch

* Move back to unit tests (poll is mocked)

* Better error message for valgrind not found

* Simplify dependency injection for BSD sockets poll test

* Improve test readability for BSD net poll

* Split out 2-in-1 test for `isAnyAddr`

* Stub out sleep function

* Improve coverage for pollSocket

* Use gmock ON_CALL instead of manual mock

* Remove unused function signature

* Use conventional deps struct instead of std functional

* Add test for socket data FD set to -1

* Add assertation for adding unblock pipe

* Use older style array alloc

* Less precision around `getNetworkDataForThread` value

* Use `ssize_t` for `ignore`

* Remove unused var

* Update ChangeLog
This commit is contained in:
Nick Bolton
2024-07-29 18:04:17 +01:00
committed by GitHub
parent cdb6dcd597
commit b02077550c
9 changed files with 301 additions and 283 deletions

View File

@ -6,6 +6,9 @@ env.ensure_in_venv(__file__)
import argparse, os, sys
import lib.cmd_utils as cmd_utils
import lib.colors as colors
valgrind_bin = "valgrind"
def main():
@ -39,7 +42,11 @@ def main():
command = [binary]
if args.valgrind:
command = ["valgrind"] + command
if not cmd_utils.has_command(valgrind_bin):
print(f"{colors.ERROR_TEXT} {valgrind_bin} not found")
sys.exit(1)
command = [valgrind_bin] + command
result = cmd_utils.run(command, print_cmd=True, check=False)
if not args.ignore_return_code: