blob: 0513d00e6e5db9e64a5683c39ed834aae17b2c40 [file] [log] [blame]
# Copyright 2019 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")
import("//build/test.gni")
driver_bind_rules("bt_transport_usb_bind") {
rules = "bt_transport_usb.bind"
bind_output = "bt-transport-usb.bindbc"
tests = "bind_tests.json"
deps = [
"//src/devices/bind/fuchsia.usb",
"//src/devices/bind/fuchsia.usb.wireless",
]
}
fuchsia_driver("bt-transport-usb-driver") {
output_name = "bt-transport-usb"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = []
deps = [ ":common" ]
}
fuchsia_driver_component("bt-transport-usb") {
visibility = [ ":*" ]
component_name = "bt-transport-usb"
deps = [ ":bt-transport-usb-driver" ]
info = "bt-transport-usb-info.json"
manifest = "meta/bt-transport-usb.cml"
}
fuchsia_driver_package("package") {
package_name = "bt-transport-usb"
driver_components = [ ":bt-transport-usb" ]
}
source_set("common") {
sources = [
"bt_transport_usb.cc",
"bt_transport_usb.h",
"packet_reassembler.h",
]
public_deps = [
":bt_transport_usb_bind",
"//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb:fuchsia.hardware.usb_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb.composite:fuchsia.hardware.usb.composite_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb.request:fuchsia.hardware.usb.request_banjo_cpp",
"//src/devices/lib/driver",
"//src/devices/usb/lib/usb",
"//src/lib/listnode",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/sync",
]
}
executable("tests_executable") {
testonly = true
output_name = "bt-transport-usb-tests"
sources = [
"bt_transport_usb_unittest.cc",
"packet_reassembler_unittest.cc",
]
deps = [
":common",
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//src/devices/testing/mock-ddk",
"//src/devices/usb/testing/descriptor-builder",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//third_party/googletest:gtest",
]
}
fuchsia_unittest_package("bt-transport-usb-tests") {
deps = [ ":tests_executable" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
group("tests") {
testonly = true
deps = [
":bt-transport-usb-tests",
":bt_transport_usb_bind_test",
]
}