mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-20 22:00:58 +00:00
c0cbc16ec8
Add pw_log_rpc unit tests and documentation. Add an enum to dictacte how to handle server writer errors in RpcLogDrain. Test: unit tests pass Change-Id: Ib22dd3414cf344fddd6f179d43fd4d533ba12fd8 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56931 Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Keir Mierle <keir@google.com>
108 lines
2.5 KiB
Plaintext
108 lines
2.5 KiB
Plaintext
# Copyright 2020 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.
|
|
|
|
import("//build_overrides/pigweed.gni")
|
|
|
|
import("$dir_pw_build/target_types.gni")
|
|
import("$dir_pw_docgen/docs.gni")
|
|
import("$dir_pw_unit_test/test.gni")
|
|
|
|
config("default_config") {
|
|
include_dirs = [ "public" ]
|
|
visibility = [ ":*" ]
|
|
}
|
|
|
|
pw_source_set("log_service") {
|
|
public_configs = [ ":default_config" ]
|
|
public = [ "public/pw_log_rpc/log_service.h" ]
|
|
sources = [ "log_service.cc" ]
|
|
deps = [
|
|
"$dir_pw_log",
|
|
"$dir_pw_log:protos.pwpb",
|
|
]
|
|
public_deps = [
|
|
":rpc_log_drain",
|
|
"$dir_pw_log:protos.raw_rpc",
|
|
]
|
|
}
|
|
|
|
pw_source_set("rpc_log_drain") {
|
|
public_configs = [ ":default_config" ]
|
|
public = [
|
|
"public/pw_log_rpc/rpc_log_drain.h",
|
|
"public/pw_log_rpc/rpc_log_drain_map.h",
|
|
]
|
|
sources = [ "rpc_log_drain.cc" ]
|
|
deps = [
|
|
"$dir_pw_log",
|
|
"$dir_pw_string",
|
|
]
|
|
public_deps = [
|
|
"$dir_pw_assert",
|
|
"$dir_pw_log:protos.pwpb",
|
|
"$dir_pw_log:protos.raw_rpc",
|
|
"$dir_pw_multisink",
|
|
"$dir_pw_protobuf",
|
|
"$dir_pw_result",
|
|
"$dir_pw_status",
|
|
"$dir_pw_sync:lock_annotations",
|
|
"$dir_pw_sync:mutex",
|
|
]
|
|
}
|
|
|
|
pw_source_set("rpc_log_drain_thread") {
|
|
public_configs = [ ":default_config" ]
|
|
public = [ "public/pw_log_rpc/rpc_log_drain_thread.h" ]
|
|
sources = []
|
|
public_deps = [
|
|
":rpc_log_drain",
|
|
"$dir_pw_multisink",
|
|
"$dir_pw_sync:thread_notification",
|
|
"$dir_pw_thread:thread",
|
|
]
|
|
}
|
|
|
|
pw_test("log_service_test") {
|
|
sources = [ "log_service_test.cc" ]
|
|
deps = [
|
|
":log_service",
|
|
"$dir_pw_containers:vector",
|
|
"$dir_pw_log",
|
|
"$dir_pw_log:proto_utils",
|
|
"$dir_pw_log:protos.pwpb",
|
|
"$dir_pw_protobuf",
|
|
"$dir_pw_result",
|
|
"$dir_pw_rpc/raw:test_method_context",
|
|
"$dir_pw_status",
|
|
"$dir_pw_string",
|
|
]
|
|
}
|
|
|
|
pw_test("rpc_log_drain_test") {
|
|
sources = [ "rpc_log_drain_test.cc" ]
|
|
deps = [ ":rpc_log_drain" ]
|
|
}
|
|
|
|
# TODO(cachinchilla): update docs.
|
|
pw_doc_group("docs") {
|
|
sources = [ "docs.rst" ]
|
|
}
|
|
|
|
pw_test_group("tests") {
|
|
tests = [
|
|
":log_service_test",
|
|
":rpc_log_drain_test",
|
|
]
|
|
}
|