blob: 9bd67dd4740a07e50657d00ccb1fd74e7aeebd87 [file]
# Copyright 2022 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
package(
default_visibility = ["//visibility:public"],
features = [
"-layering_check",
"-ctad_warnings",
],
)
licenses(["notice"])
cc_library(
name = "server_api",
srcs = [
"method.cc",
"server_reader_writer.cc",
],
hdrs = [
"public/pw_rpc/nanopb/internal/method.h",
"public/pw_rpc/nanopb/internal/method_union.h",
"public/pw_rpc/nanopb/server_reader_writer.h",
],
implementation_deps = ["//pw_log"],
strip_include_prefix = "public",
deps = [
":common",
"//pw_bytes",
"//pw_function",
"//pw_rpc",
"//pw_rpc/raw:server_api",
"//pw_span",
"//pw_status",
],
)
cc_library(
name = "client_api",
hdrs = ["public/pw_rpc/nanopb/client_reader_writer.h"],
strip_include_prefix = "public",
deps = [
":common",
"//pw_rpc",
],
)
cc_library(
name = "common",
srcs = ["common.cc"],
hdrs = [
"public/pw_rpc/nanopb/internal/common.h",
"public/pw_rpc/nanopb/server_reader_writer.h",
],
implementation_deps = [
"//pw_assert:check",
"//pw_log",
"//pw_result",
],
strip_include_prefix = "public",
deps = [
"//pw_bytes",
"//pw_rpc",
"//pw_status",
"@nanopb",
],
)
cc_library(
name = "test_method_context",
hdrs = [
"public/pw_rpc/nanopb/fake_channel_output.h",
"public/pw_rpc/nanopb/test_method_context.h",
],
strip_include_prefix = "public",
tags = ["noclangtidy"],
deps = [
":common",
":server_api",
"//pw_assert:assert",
"//pw_bytes",
"//pw_containers:vector",
"//pw_containers:wrapped_iterator",
"//pw_preprocessor",
"//pw_rpc",
"//pw_rpc:fake_channel_output",
"//pw_rpc:internal_test_utils",
],
)
cc_library(
name = "client_testing",
hdrs = [
"public/pw_rpc/nanopb/client_testing.h",
],
strip_include_prefix = "public",
tags = ["noclangtidy"],
deps = [
":test_method_context",
"//pw_bytes",
"//pw_rpc",
"//pw_rpc/raw:client_testing",
],
)
cc_library(
name = "client_server_testing",
hdrs = [
"public/pw_rpc/nanopb/client_server_testing.h",
],
strip_include_prefix = "public",
tags = ["noclangtidy"],
deps = [
":test_method_context",
"//pw_rpc:client_server_testing",
],
)
cc_library(
name = "client_server_testing_threaded",
hdrs = [
"public/pw_rpc/nanopb/client_server_testing_threaded.h",
],
strip_include_prefix = "public",
tags = ["noclangtidy"],
deps = [
":test_method_context",
"//pw_rpc:client_server_testing_threaded",
],
)
cc_library(
name = "internal_test_utils",
hdrs = ["pw_rpc_nanopb_private/internal_test_utils.h"],
tags = ["noclangtidy"],
deps = ["//pw_span"],
)
cc_library(
name = "echo_service",
hdrs = ["public/pw_rpc/echo_service_nanopb.h"],
strip_include_prefix = "public",
deps = [
"//pw_rpc:echo_nanopb_rpc",
],
)
pw_cc_test(
name = "callback_test",
srcs = ["callback_test.cc"],
features = ["-conversion_warnings"],
deps = [
":client_testing",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"//pw_sync:binary_semaphore",
"//pw_thread:non_portable_test_thread_options",
"//pw_thread:sleep",
"//pw_thread:thread",
"//pw_thread:yield",
"//pw_thread_stl:non_portable_test_thread_options",
],
)
# TODO: b/242059613 - Enable this library when logging_event_handler can be used.
filegroup(
name = "client_integration_test",
srcs = [
"client_integration_test.cc",
],
#deps = [
# "//pw_rpc:integration_testing",
# "//pw_sync:binary_semaphore",
# "//pw_rpc:benchmark_cc.nanopb_rpc",
#]
)
pw_cc_test(
name = "client_call_test",
srcs = [
"client_call_test.cc",
],
features = ["-conversion_warnings"],
deps = [
":client_api",
":internal_test_utils",
"//pw_rpc:internal_test_utils",
"//pw_rpc:pw_rpc_test_nanopb",
],
)
pw_cc_test(
name = "client_reader_writer_test",
srcs = [
"client_reader_writer_test.cc",
],
features = ["-conversion_warnings"],
deps = [
":client_api",
":client_testing",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "client_server_context_test",
srcs = [
"client_server_context_test.cc",
],
features = ["-conversion_warnings"],
deps = [
":client_server_testing",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"//pw_sync:mutex",
],
)
pw_cc_test(
name = "client_server_context_threaded_test",
srcs = [
"client_server_context_threaded_test.cc",
],
features = ["-conversion_warnings"],
target_compatible_with = incompatible_with_mcu(),
deps = [
":client_server_testing_threaded",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"//pw_sync:binary_semaphore",
"//pw_sync:mutex",
"//pw_thread:non_portable_test_thread_options",
"//pw_thread_stl:non_portable_test_thread_options",
],
)
pw_cc_test(
name = "codegen_test",
srcs = [
"codegen_test.cc",
],
features = ["-conversion_warnings"],
deps = [
":internal_test_utils",
":test_method_context",
"//pw_preprocessor",
"//pw_rpc",
"//pw_rpc:internal_test_utils",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "fake_channel_output_test",
srcs = ["fake_channel_output_test.cc"],
features = ["-conversion_warnings"],
deps = [
":test_method_context",
"//pw_rpc",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "method_test",
srcs = ["method_test.cc"],
features = ["-conversion_warnings"],
deps = [
":internal_test_utils",
":server_api",
"//pw_containers:algorithm",
"//pw_rpc",
"//pw_rpc:internal_test_utils",
"//pw_rpc:pw_rpc_test_nanopb",
],
)
pw_cc_test(
name = "method_info_test",
srcs = ["method_info_test.cc"],
features = ["-conversion_warnings"],
deps = [
"//pw_rpc",
"//pw_rpc:internal_test_utils",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "method_lookup_test",
srcs = ["method_lookup_test.cc"],
features = ["-conversion_warnings"],
deps = [
":test_method_context",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"//pw_rpc/raw:test_method_context",
],
)
pw_cc_test(
name = "method_union_test",
srcs = ["method_union_test.cc"],
features = ["-conversion_warnings"],
deps = [
":internal_test_utils",
":server_api",
"//pw_rpc:internal_test_utils",
"//pw_rpc:pw_rpc_test_nanopb",
],
)
pw_cc_test(
name = "echo_service_test",
srcs = ["echo_service_test.cc"],
features = ["-conversion_warnings"],
deps = [
":echo_service",
":test_method_context",
],
)
pw_cc_test(
name = "server_reader_writer_test",
srcs = ["server_reader_writer_test.cc"],
features = ["-conversion_warnings"],
deps = [
":test_method_context",
"//pw_rpc",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "serde_test",
srcs = ["serde_test.cc"],
features = ["-conversion_warnings"],
deps = [
":common",
"//pw_rpc:pw_rpc_test_nanopb",
],
)
pw_cc_test(
name = "server_callback_test",
srcs = ["server_callback_test.cc"],
features = ["-conversion_warnings"],
deps = [
":test_method_context",
"//pw_rpc",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"@nanopb",
],
)
pw_cc_test(
name = "stub_generation_test",
srcs = ["stub_generation_test.cc"],
features = ["-conversion_warnings"],
deps = [
"//pw_rpc:pw_rpc_test_nanopb_rpc",
],
)
pw_cc_test(
name = "synchronous_call_test",
srcs = ["synchronous_call_test.cc"],
features = ["-conversion_warnings"],
deps = [
":test_method_context",
"//pw_chrono:system_clock",
"//pw_rpc",
"//pw_rpc:pw_rpc_test_nanopb_rpc",
"//pw_rpc:synchronous_client_api",
"//pw_status",
"//pw_thread:thread",
"//pw_work_queue",
"//pw_work_queue:stl_test_thread",
"//pw_work_queue:test_thread_header",
],
)
sphinx_docs_library(
name = "docs",
srcs = [
"Kconfig",
"docs.rst",
],
target_compatible_with = incompatible_with_mcu(),
)