aboutsummaryrefslogtreecommitdiff
path: root/pw_rpc/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'pw_rpc/BUILD.bazel')
-rw-r--r--pw_rpc/BUILD.bazel86
1 files changed, 23 insertions, 63 deletions
diff --git a/pw_rpc/BUILD.bazel b/pw_rpc/BUILD.bazel
index 8574e9f53..dca4569dd 100644
--- a/pw_rpc/BUILD.bazel
+++ b/pw_rpc/BUILD.bazel
@@ -12,12 +12,10 @@
# License for the specific language governing permissions and limitations under
# the License.
-load("//pw_build:pigweed.bzl", "pw_cc_library", "pw_cc_test")
-load("//pw_protobuf_compiler:proto.bzl", "pw_proto_library")
-load("//pw_protobuf_compiler:pw_proto_library.bzl", "pw_proto_filegroup")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
-load("@rules_proto_grpc//:defs.bzl", "proto_plugin")
+load("//pw_build:pigweed.bzl", "pw_cc_library", "pw_cc_test")
+load("//pw_protobuf_compiler:pw_proto_library.bzl", "pw_proto_filegroup", "pw_proto_library")
package(default_visibility = ["//visibility:public"])
@@ -46,7 +44,7 @@ pw_cc_library(
],
)
-# TODO(b/242059613): Build this as a cc_binary and use it in integration tests.
+# TODO: b/242059613 - Build this as a cc_binary and use it in integration tests.
filegroup(
name = "test_rpc_server",
srcs = ["test_rpc_server.cc"],
@@ -131,6 +129,7 @@ pw_cc_library(
pw_cc_library(
name = "synchronous_client_api",
+ srcs = ["public/pw_rpc/internal/synchronous_call_impl.h"],
hdrs = [
"public/pw_rpc/synchronous_call.h",
"public/pw_rpc/synchronous_call_result.h",
@@ -201,11 +200,11 @@ pw_cc_library(
"public/pw_rpc/internal/fake_channel_output.h",
"public/pw_rpc/internal/method_impl_tester.h",
"public/pw_rpc/internal/method_info_tester.h",
- "public/pw_rpc/internal/test_method.h",
"public/pw_rpc/internal/test_method_context.h",
"public/pw_rpc/internal/test_utils.h",
"public/pw_rpc/payloads_view.h",
"pw_rpc_private/fake_server_reader_writer.h",
+ "pw_rpc_private/test_method.h",
],
includes = [
".",
@@ -242,11 +241,11 @@ pw_cc_library(
"//pw_log",
"//pw_stream:socket_stream",
"//pw_unit_test",
- "//pw_unit_test:logging_event_handler",
+ "//pw_unit_test:logging",
],
)
-# TODO(b/242059613): Add the client integration test to the build.
+# TODO: b/242059613 - Add the client integration test to the build.
filegroup(
name = "client_integration_test",
srcs = ["client_integration_test.cc"],
@@ -271,10 +270,10 @@ pw_cc_test(
":pw_rpc_test_cc.raw_rpc",
"//pw_rpc/raw:client_testing",
"//pw_sync:binary_semaphore",
+ "//pw_thread:non_portable_test_thread_options",
"//pw_thread:sleep",
- "//pw_thread:test_threads_header",
"//pw_thread:yield",
- "//pw_thread_stl:test_threads",
+ "//pw_thread_stl:non_portable_test_thread_options",
],
)
@@ -303,6 +302,7 @@ pw_cc_test(
],
deps = [
":pw_rpc",
+ "//pw_fuzzer:fuzztest",
],
)
@@ -313,6 +313,7 @@ pw_cc_test(
],
deps = [
":pw_rpc",
+ "//pw_fuzzer:fuzztest",
],
)
@@ -356,11 +357,20 @@ pw_cc_test(
deps = [":internal_test_utils"],
)
-# TODO(b/234874064): Add test_helpers_test when it is possible to use .options
-# in bazel build.
-filegroup(
+pw_cc_test(
name = "test_helpers_test",
srcs = ["test_helpers_test.cc"],
+ deps = [
+ ":test_helpers",
+ "//pw_result",
+ "//pw_rpc/pwpb:client_testing",
+ "//pw_rpc/pwpb:echo_service",
+ "//pw_rpc/pwpb:server_api",
+ "//pw_status",
+ "//pw_sync:interrupt_spin_lock",
+ "//pw_sync:lock_annotations",
+ "//pw_sync:timed_thread_notification",
+ ],
)
proto_library(
@@ -398,54 +408,6 @@ pw_proto_library(
deps = [":pw_rpc_test_proto"],
)
-proto_plugin(
- name = "pw_cc_plugin_raw",
- outputs = [
- "{protopath}.raw_rpc.pb.h",
- ],
- protoc_plugin_name = "raw_rpc",
- tool = "@pigweed//pw_rpc/py:plugin_raw",
- use_built_in_shell_environment = True,
- visibility = ["//visibility:public"],
-)
-
-proto_plugin(
- name = "pw_cc_plugin_nanopb_rpc",
- outputs = [
- "{protopath}.rpc.pb.h",
- ],
- protoc_plugin_name = "nanopb_rpc",
- tool = "@pigweed//pw_rpc/py:plugin_nanopb",
- use_built_in_shell_environment = True,
- visibility = ["//visibility:public"],
-)
-
-proto_plugin(
- name = "nanopb_plugin",
- options = [
- "--library-include-format='#include\"%s\"'",
- ],
- outputs = [
- "{protopath}.pb.h",
- "{protopath}.pb.c",
- ],
- separate_options_flag = True,
- tool = "@com_github_nanopb_nanopb//:bazel_generator",
- use_built_in_shell_environment = True,
- visibility = ["//visibility:public"],
-)
-
-proto_plugin(
- name = "pw_cc_plugin_pwpb_rpc",
- outputs = [
- "{protopath}.rpc.pwpb.h",
- ],
- protoc_plugin_name = "pwpb_rpc",
- tool = "@pigweed//pw_rpc/py:plugin_pwpb",
- use_built_in_shell_environment = True,
- visibility = ["//visibility:public"],
-)
-
pw_proto_filegroup(
name = "echo_proto_and_options",
srcs = ["echo.proto"],
@@ -465,6 +427,4 @@ py_proto_library(
pw_proto_library(
name = "echo_cc",
deps = [":echo_proto"],
- # TODO(tpudlik): We should provide echo.options to nanopb here, but the
- # current proto codegen implementation provides no mechanism for doing so.
)