| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/bazel/bazel_fuchsia_test_package.gni") |
| import("//build_overrides/pigweed.gni") |
| import("$dir_pw_build/target_types.gni") |
| import("$dir_pw_unit_test/test.gni") |
| |
| dir_public_gatt = "../public/pw_bluetooth_sapphire/internal/host/gatt" |
| |
| # Basic target with protocol definitions and no logic, suitable for test |
| # emulation. |
| pw_source_set("definitions") { |
| public = [ "$dir_public_gatt/gatt_defs.h" ] |
| |
| sources = [ "gatt_defs.cc" ] |
| |
| public_deps = [ "//src/connectivity/bluetooth/core/bt-host/att:definitions" ] |
| } |
| |
| pw_source_set("gatt") { |
| public = [ |
| "$dir_public_gatt/client.h", |
| "$dir_public_gatt/connection.h", |
| "$dir_public_gatt/gatt.h", |
| "$dir_public_gatt/generic_attribute_service.h", |
| "$dir_public_gatt/local_service_manager.h", |
| "$dir_public_gatt/remote_characteristic.h", |
| "$dir_public_gatt/remote_service.h", |
| "$dir_public_gatt/remote_service_manager.h", |
| "$dir_public_gatt/server.h", |
| "$dir_public_gatt/types.h", |
| ] |
| |
| sources = [ |
| "client.cc", |
| "connection.cc", |
| "gatt.cc", |
| "generic_attribute_service.cc", |
| "local_service_manager.cc", |
| "remote_characteristic.cc", |
| "remote_service.cc", |
| "remote_service_manager.cc", |
| "server.cc", |
| "types.cc", |
| ] |
| |
| public_deps = [ |
| ":definitions", |
| "$dir_pw_third_party/fuchsia:fit", |
| "//src/connectivity/bluetooth/core/bt-host:config", |
| "//src/connectivity/bluetooth/core/bt-host/att", |
| ] |
| } |
| |
| pw_source_set("testing") { |
| testonly = true |
| |
| testonly = pw_unit_test_TESTONLY |
| |
| public = [ |
| "$dir_public_gatt/fake_client.h", |
| "$dir_public_gatt/fake_layer.h", |
| "$dir_public_gatt/mock_server.h", |
| ] |
| |
| sources = [ |
| "fake_client.cc", |
| "fake_layer.cc", |
| "mock_server.cc", |
| ] |
| |
| public_deps = [ |
| ":gatt", |
| "$dir_pw_async:heap_dispatcher", |
| "$dir_pw_unit_test", |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/common:uuid_string_util", |
| ] |
| } |
| |
| pw_test("tests") { |
| sources = [ |
| "client_test.cc", |
| "gatt_test.cc", |
| "generic_attribute_service_test.cc", |
| "local_service_manager_test.cc", |
| "remote_service_manager_test.cc", |
| "server_test.cc", |
| ] |
| |
| deps = [ |
| ":gatt", |
| ":testing", |
| "//src/connectivity/bluetooth/core/bt-host/att", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap:testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| ] |
| |
| test_main = "//src/connectivity/bluetooth/core/bt-host/testing:gtest_main" |
| } |
| |
| bazel_fuchsia_test_package("test_pkg") { |
| test_package_name = "gatt_tests" |
| test_component_names = [ "gatt_test_autogen_cml" ] |
| } |