| # Copyright 2018 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/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| |
| driver_bind_rules("bt-hci-virtual-bind") { |
| rules = "bt-hci-virtual.bind" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.platform" ] |
| } |
| |
| source_set("common") { |
| testonly = true |
| |
| sources = [ |
| "controller.h", |
| "driver.cc", |
| "emulated_peer.cc", |
| "emulated_peer.h", |
| "emulator.cc", |
| "emulator.h", |
| "log.h", |
| "loopback.cc", |
| "loopback.h", |
| ] |
| |
| deps = [ |
| ":bt-hci-virtual-bind", |
| "//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_c", |
| "//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.test:fuchsia.hardware.test_banjo_cpp", |
| "//sdk/fidl/fuchsia.bluetooth.test:fuchsia.bluetooth.test_hlcpp", |
| "//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp", |
| "//sdk/lib/fit-promise", |
| "//sdk/lib/syslog/cpp", |
| "//src/connectivity/bluetooth/core/bt-host/fidl:helpers", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/testing:fake_controller", |
| "//src/connectivity/bluetooth/lib/fidl", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//third_party/pigweed/backends/pw_async_fuchsia:dispatcher", |
| "//third_party/pigweed/backends/pw_log:dfv1", |
| "//third_party/pigweed/backends/pw_random:zircon_random_generator", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-default", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_driver("fuchsia_driver") { |
| output_name = "bt-hci-virtual" |
| testonly = true |
| sources = [] |
| deps = [ |
| ":common", |
| "//sdk/lib/syslog/cpp:backend", |
| ] |
| } |
| |
| fuchsia_driver_component("driver") { |
| testonly = true |
| component_name = "bt-hci-virtual" |
| deps = [ ":fuchsia_driver" ] |
| info = "driver-info.json" |
| manifest = "meta/driver.cml" |
| } |
| |
| fuchsia_driver_package("virtual") { |
| testonly = true |
| |
| driver_components = [ ":driver" ] |
| |
| # This package is reachable from //src/connectivity/bluetooth |
| } |
| |
| executable("tests_executable") { |
| testonly = true |
| |
| output_name = "bt-hci-virtual-tests" |
| |
| sources = [ "loopback_unittests.cc" ] |
| |
| deps = [ |
| ":common", |
| "//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.test:fuchsia.hardware.test_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp", |
| "//sdk/lib/syslog/cpp:backend", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("bt-hci-virtual-tests") { |
| deps = [ ":tests_executable" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bt-hci-virtual-bind_test", |
| ":bt-hci-virtual-tests", |
| ] |
| } |