1# Copyright 2019 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"])  # Apache License 2.0
24
25pw_cc_library(
26    name = "pw_unit_test",
27    srcs = [
28        "framework.cc",
29    ],
30    hdrs = [
31        "public/pw_unit_test/event_handler.h",
32        "public/pw_unit_test/framework.h",
33        "public_overrides/gtest/gtest.h",
34    ],
35    includes = [
36        "public",
37        "public_overrides",
38    ],
39    deps = [
40        "//pw_polyfill",
41        "//pw_preprocessor",
42        "//pw_string",
43    ],
44)
45
46pw_cc_library(
47    name = "simple_printing_event_handler",
48    srcs = ["simple_printing_event_handler.cc"],
49    hdrs = [
50        "public/pw_unit_test/simple_printing_event_handler.h",
51    ],
52    includes = [
53        "public",
54    ],
55    deps = [
56        "//pw_preprocessor",
57        "//pw_unit_test",
58    ],
59)
60
61filegroup(
62    name = "logging_event_handler",
63    srcs = [
64        "logging_event_handler.cc",
65        "public/pw_unit_test/logging_event_handler.h",
66    ],
67)
68
69filegroup(
70    name = "logging_main",
71    srcs = [
72        "logging_main.cc",
73    ],
74)
75
76pw_cc_library(
77    name = "main",
78    srcs = [
79        "simple_printing_main.cc",
80    ],
81    deps = [
82        ":pw_unit_test",
83        ":simple_printing_event_handler",
84        "//pw_span",
85        "//pw_sys_io",
86    ],
87)
88
89pw_cc_library(
90    name = "rpc_service",
91    hdrs = [
92        "public/pw_unit_test/internal/rpc_event_handler.h",
93        "public/pw_unit_test/unit_test_service.h",
94    ],
95    srcs = [
96        "rpc_event_handler.cc",
97        "unit_test_service.cc",
98    ],
99    deps = [
100        ":pw_unit_test",
101        "//pw_log",
102    ],
103)
104
105pw_cc_library(
106    name = "rpc_main",
107    srcs = [
108        "rpc_main.cc",
109    ],
110    deps = [
111        ":pw_unit_test",
112        ":rpc_service",
113        "//pw_hdlc:pw_rpc",
114        "//pw_log",
115        "//pw_rpc:server",
116    ],
117)
118
119pw_cc_test(
120    name = "framework_test",
121    srcs = ["framework_test.cc"],
122    deps = [
123        ":pw_unit_test",
124    ],
125)
126