1# Copyright 2020 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_library", 18 "pw_cc_test", 19) 20 21package(default_visibility = ["//visibility:public"]) 22 23licenses(["notice"]) 24 25pw_cc_library( 26 name = "server_api", 27 srcs = [ 28 "method.cc", 29 ], 30 hdrs = [ 31 "public/pw_rpc/raw/internal/method.h", 32 "public/pw_rpc/raw/internal/method_union.h", 33 "public/pw_rpc/raw/server_reader_writer.h", 34 ], 35 includes = ["public"], 36 deps = [ 37 "//pw_bytes", 38 "//pw_rpc", 39 "//pw_rpc:internal_packet_cc.pwpb", 40 "//pw_status", 41 ], 42) 43 44pw_cc_library( 45 name = "client_api", 46 hdrs = ["public/pw_rpc/raw/client_reader_writer.h"], 47 includes = ["public"], 48 deps = [ 49 "//pw_bytes", 50 "//pw_rpc", 51 "//pw_rpc:internal_packet_cc.pwpb", 52 ], 53) 54 55pw_cc_library( 56 name = "fake_channel_output", 57 hdrs = ["public/pw_rpc/raw/fake_channel_output.h"], 58 includes = ["public"], 59 deps = [ 60 ":server_api", 61 "//pw_assert", 62 "//pw_containers", 63 ], 64) 65 66pw_cc_library( 67 name = "test_method_context", 68 hdrs = ["public/pw_rpc/raw/test_method_context.h"], 69 includes = ["public"], 70 deps = [ 71 ":fake_channel_output", 72 ":server_api", 73 "//pw_assert", 74 "//pw_containers:vector", 75 "//pw_preprocessor", 76 "//pw_rpc", 77 "//pw_rpc:internal_test_utils", 78 ], 79) 80 81pw_cc_library( 82 name = "client_testing", 83 srcs = ["client_testing.cc"], 84 hdrs = ["public/pw_rpc/raw/client_testing.h"], 85 deps = [ 86 ":test_method_context", 87 "//pw_assert", 88 "//pw_bytes", 89 "//pw_log", 90 "//pw_rpc", 91 ], 92) 93 94pw_cc_test( 95 name = "client_test", 96 srcs = [ 97 "client_test.cc", 98 ], 99 deps = [ 100 ":client_api", 101 ":client_testing", 102 "//pw_rpc:internal_test_utils", 103 ], 104) 105 106pw_cc_test( 107 name = "client_reader_writer_test", 108 srcs = ["client_reader_writer_test.cc"], 109 deps = [ 110 ":client_api", 111 ":client_testing", 112 "//pw_rpc:pw_rpc_test_cc.raw_rpc", 113 ], 114) 115 116pw_cc_test( 117 name = "codegen_test", 118 srcs = [ 119 "codegen_test.cc", 120 ], 121 deps = [ 122 ":client_api", 123 ":client_testing", 124 ":server_api", 125 ":test_method_context", 126 "//pw_protobuf", 127 "//pw_rpc:internal_test_utils", 128 "//pw_rpc:pw_rpc_test_cc.pwpb", 129 "//pw_rpc:pw_rpc_test_cc.raw_rpc", 130 ], 131) 132 133pw_cc_test( 134 name = "method_test", 135 srcs = [ 136 "method_test.cc", 137 ], 138 deps = [ 139 ":server_api", 140 "//pw_protobuf", 141 "//pw_rpc:internal_test_utils", 142 "//pw_rpc:pw_rpc_test_cc.pwpb", 143 ], 144) 145 146pw_cc_test( 147 name = "method_info_test", 148 srcs = [ 149 "method_info_test.cc", 150 ], 151 deps = [ 152 "//pw_rpc:internal_test_utils", 153 "//pw_rpc:pw_rpc_test_cc.raw_rpc", 154 ], 155) 156 157pw_cc_test( 158 name = "method_union_test", 159 srcs = [ 160 "method_union_test.cc", 161 ], 162 deps = [ 163 ":server_api", 164 "//pw_protobuf", 165 "//pw_rpc:internal_test_utils", 166 "//pw_rpc:pw_rpc_test_cc.pwpb", 167 ], 168) 169 170pw_cc_test( 171 name = "server_reader_writer_test", 172 srcs = ["server_reader_writer_test.cc"], 173 deps = [ 174 ":test_method_context", 175 "//pw_rpc:internal_test_utils", 176 "//pw_rpc:pw_rpc_test_cc.pwpb", 177 "//pw_rpc:pw_rpc_test_cc.raw_rpc", 178 ], 179) 180 181pw_cc_test( 182 name = "stub_generation_test", 183 srcs = ["stub_generation_test.cc"], 184 deps = [ 185 "//pw_rpc:pw_rpc_test_cc.pwpb", 186 "//pw_rpc:pw_rpc_test_cc.raw_rpc", 187 ], 188) 189