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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_build/target_types.gni") 18import("$dir_pw_docgen/docs.gni") 19import("$dir_pw_unit_test/test.gni") 20 21config("public") { 22 include_dirs = [ "public" ] 23 visibility = [ ":*" ] 24} 25 26pw_source_set("server_api") { 27 public_configs = [ ":public" ] 28 public = [ 29 "public/pw_rpc/raw/internal/method.h", 30 "public/pw_rpc/raw/internal/method_union.h", 31 "public/pw_rpc/raw/server_reader_writer.h", 32 ] 33 sources = [ "method.cc" ] 34 public_deps = [ 35 "..:server", 36 dir_pw_bytes, 37 ] 38} 39 40pw_source_set("client_api") { 41 public_configs = [ ":public" ] 42 public = [ "public/pw_rpc/raw/client_reader_writer.h" ] 43 public_deps = [ 44 "..:client", 45 dir_pw_bytes, 46 ] 47} 48 49pw_source_set("fake_channel_output") { 50 public = [ "public/pw_rpc/raw/fake_channel_output.h" ] 51 public_configs = [ ":public" ] 52 public_deps = [ "..:fake_channel_output" ] 53} 54 55pw_source_set("test_method_context") { 56 public_configs = [ ":public" ] 57 public = [ "public/pw_rpc/raw/test_method_context.h" ] 58 public_deps = [ 59 ":fake_channel_output", 60 ":server_api", 61 "..:test_utils", 62 dir_pw_assert, 63 dir_pw_containers, 64 ] 65} 66 67pw_source_set("client_testing") { 68 public = [ "public/pw_rpc/raw/client_testing.h" ] 69 sources = [ "client_testing.cc" ] 70 public_deps = [ 71 ":fake_channel_output", 72 "..:client", 73 ] 74 deps = [ "..:log_config" ] 75} 76 77pw_test_group("tests") { 78 tests = [ 79 ":codegen_test", 80 ":client_test", 81 ":client_reader_writer_test", 82 ":method_test", 83 ":method_info_test", 84 ":method_union_test", 85 ":server_reader_writer_test", 86 ":stub_generation_test", 87 ] 88} 89 90pw_test("codegen_test") { 91 deps = [ 92 ":client_testing", 93 ":test_method_context", 94 "..:test_protos.pwpb", 95 "..:test_protos.raw_rpc", 96 dir_pw_protobuf, 97 ] 98 sources = [ "codegen_test.cc" ] 99} 100 101pw_test("client_test") { 102 deps = [ 103 ":client_api", 104 ":client_testing", 105 "..:test_utils", 106 ] 107 sources = [ "client_test.cc" ] 108} 109 110pw_test("client_reader_writer_test") { 111 deps = [ 112 ":client_api", 113 ":client_testing", 114 "..:test_protos.raw_rpc", 115 ] 116 sources = [ "client_reader_writer_test.cc" ] 117} 118 119pw_test("method_test") { 120 deps = [ 121 ":server_api", 122 "..:test_protos.pwpb", 123 "..:test_protos.raw_rpc", 124 "..:test_utils", 125 dir_pw_protobuf, 126 ] 127 sources = [ "method_test.cc" ] 128} 129 130pw_test("method_info_test") { 131 deps = [ 132 "..:common", 133 "..:test_protos.raw_rpc", 134 "..:test_utils", 135 ] 136 sources = [ "method_info_test.cc" ] 137} 138 139pw_test("method_union_test") { 140 deps = [ 141 ":server_api", 142 "..:test_protos.pwpb", 143 "..:test_utils", 144 dir_pw_protobuf, 145 ] 146 sources = [ "method_union_test.cc" ] 147} 148 149pw_test("server_reader_writer_test") { 150 deps = [ 151 ":server_api", 152 ":test_method_context", 153 "..:test_protos.raw_rpc", 154 ] 155 sources = [ "server_reader_writer_test.cc" ] 156} 157 158pw_test("stub_generation_test") { 159 deps = [ "..:test_protos.raw_rpc" ] 160 sources = [ "stub_generation_test.cc" ] 161} 162