From 443f4dc203d1c541a6e9df97d53b29cf7875c697 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Tue, 10 Oct 2023 11:30:18 -0700 Subject: [PATCH] chore: add more tests to bazel --- test/BUILD.bazel | 143 ++++++++++++++++++++++++++++++++++-- test/archetypes/BUILD.bazel | 19 +++++ 2 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 test/archetypes/BUILD.bazel diff --git a/test/BUILD.bazel b/test/BUILD.bazel index 7582be07ef..2a5c62b1c5 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -5,11 +5,144 @@ cc_library( hdrs = ["unit_test.hpp"], ) -cc_test( - name = "any_completion_executor", - srcs = ["any_completion_executor.cpp"], +_TESTS = { + "any_completion_executor": [], + "any_completion_handler": [], + "any_io_executor": [], + "append": [], + "as_tuple": [], + "associated_allocator": [], + "associated_cancellation_slot": [], + "associated_executor": [], + "associated_immediate_executor": [], + "associator": [], + "async_result": [], + "awaitable": [], + "basic_datagram_socket": [], + "basic_deadline_timer": [], + "basic_file": [], + "basic_random_access_file": [], + "basic_raw_socket": [], + "basic_readable_pipe": [], + "basic_seq_packet_socket": [], + "basic_serial_port": [], + "basic_signal_set": [], + "basic_socket": [], + "basic_socket_acceptor": [], + "basic_stream_file": [], + "basic_stream_socket": [], + "basic_streambuf": [], + "basic_waitable_timer": [], + "basic_writable_pipe": [], + "bind_allocator": [], + "bind_cancellation_slot": [], + "bind_executor": [], + "bind_immediate_executor": [], + "buffer": [], + "buffer_registration": [], + "buffered_read_stream": [ + "//archetypes:async_result", + ], + "buffered_stream": [ + "//archetypes:async_result", + ], + "buffered_write_stream": [ + "//archetypes:async_result", + ], + "buffers_iterator": [], + "cancellation_signal": [], + "cancellation_state": [], + "cancellation_type": [], + "co_spawn": [], + "completion_condition": [], + "compose": [], + "connect": [], + "connect_pipe": [], + "consign": [], + "coroutine": [], + "deadline_timer": [ + "//archetypes:async_result", + ], + "defer": [], + "deferred": [], + "detached": [], + "dispatch": [], + "error": [], + "execution_context": [], + "executor": [], + "executor_work_guard": [], + "file_base": [], + "high_resolution_timer": [], + "io_context": [], + "io_context_strand": [], + "is_read_buffered": [], + "is_write_buffered": [], + "packaged_task": [], + "placeholders": [], + "post": [], + "prepend": [], + "random_access_file": [ + "//archetypes:async_result", + ], + "read": [ + "//archetypes:async_result", + ], + "read_at": [ + "//archetypes:async_result", + ], + "read_until": [ + "//archetypes:async_result", + ], + "readable_pipe": [ + "//archetypes:async_result", + ], + "recycling_allocator": [], + "redirect_error": [], + "registered_buffer": [], + "serial_port": [ + "//archetypes:async_result", + ], + "serial_port_base": [], + "signal_set": [ + "//archetypes:async_result", + ], + "signal_set_base": [], + "socket_base": [], + "static_thread_pool": [], + "steady_timer": [], + "strand": [], + "stream_file": [ + "//archetypes:async_result", + ], + "streambuf": [], + "system_context": [], + "system_executor": [], + "system_timer": [], + "this_coro": [], + "thread_pool": [], + "time_traits": [], + "use_awaitable": [], + "use_future": [ + "//archetypes:async_ops", + ], + "uses_executor": [], + "wait_traits": [], + "writable_pipe": [ + "//archetypes:async_result", + ], + "write": [ + "//archetypes:async_result", + ], + "write_at": [ + "//archetypes:async_result", + ], +} + +[cc_test( + name = test, + srcs = ["{}.cpp".format(test)], deps = [ ":unit_test", "@boost.asio", - ], -) + ] + _TESTS[test], +) for test in _TESTS] diff --git a/test/archetypes/BUILD.bazel b/test/archetypes/BUILD.bazel new file mode 100644 index 0000000000..a61ffbd89a --- /dev/null +++ b/test/archetypes/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "async_result", + hdrs = ["async_result.hpp"], + deps = [ + "@boost.asio", + ], +) + +cc_library( + name = "async_ops", + hdrs = ["async_ops.hpp"], + deps = [ + "@boost.asio", + ], +)