blob: 097266fa5572357799016a69738fecb3e59e6dfa [file] [log] [blame] [edit]
# Copyright 2022 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.
# This file was generated by the `fx create` command. The template
# is located at `//tools/create/templates/driver-default/BUILD.gn.tmpl-cpp`.
# If you find something broken, we are eager to review fixes.
import("//build/bind/bind.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
group("usb-fastboot-function") {
deps = [ ":pkg" ]
}
group("tests") {
testonly = true
deps = [ ":usb-fastboot-function-test" ]
}
driver_bind_rules("bind") {
rules = "meta/usb_fastboot_function.bind"
bind_output = "usb_fastboot_function.bindbc"
deps = [
"//src/devices/bind/fuchsia.google.platform.usb",
"//src/devices/bind/fuchsia.usb",
"//src/devices/bind/fuchsia.usb.comm",
]
}
source_set("usb-fastboot-function-common") {
sources = [
"usb_fastboot_function.cc",
"usb_fastboot_function.h",
]
public_deps = [
":bind",
"//sdk/fidl/fuchsia.hardware.fastboot:fuchsia.hardware.fastboot_cpp",
"//sdk/fidl/fuchsia.hardware.usb.endpoint:fuchsia.hardware.usb.endpoint_cpp",
"//sdk/fidl/fuchsia.hardware.usb.function:fuchsia.hardware.usb.function_cpp",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/devfs/cpp",
"//src/devices/usb/lib/usb:peripheral",
"//src/devices/usb/lib/usb:usb-dfv2-compat-logging",
"//src/devices/usb/lib/usb-endpoint:usb-endpoint-client-dfv2-compat-logging",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
]
}
fuchsia_cc_driver("driver") {
output_name = "usb-fastboot-function"
deps = [ ":usb-fastboot-function-common" ]
}
fuchsia_driver_component("component") {
component_name = "usb-fastboot-function"
deps = [ ":driver" ]
info = "meta/usb_fastboot_function-info.json"
manifest = "meta/usb_fastboot_function.cml"
}
fuchsia_driver_package("pkg") {
package_name = "usb-fastboot-function"
driver_components = [ ":component" ]
}
test("usb-fastboot-function-test-bin") {
sources = [ "unit-tests.cc" ]
deps = [
":usb-fastboot-function-common",
"//sdk/fidl/fuchsia.hardware.fastboot:fuchsia.hardware.fastboot_cpp_testing",
"//sdk/lib/driver/testing/cpp",
"//sdk/lib/inspect/testing/cpp:zxtest",
"//src/devices/usb/lib/usb:usb-dfv2-compat-logging",
"//src/devices/usb/lib/usb-endpoint:fake-usb-endpoint-server-zxtest",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("usb-fastboot-function-test") {
test_specs = {
log_settings = {
# VMO fails to be unregistered during test fixture destruction due to the error:
#
# "Failed to unregister vmo FIDL operation failed due to dispatcher error,
# status: ZX_ERR_CANCELED (-23)".
#
# Ignore this error for now since it doesn't seem to be the issue of the driver.
max_severity = "ERROR"
}
}
deps = [ ":usb-fastboot-function-test-bin" ]
}