| # Copyright 2020 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("usb_hci_test_bind") { |
| rules = "usb_hci_test.bind" |
| tests = "test_bind.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.google.platform.usb", |
| "//src/devices/bind/fuchsia.usb", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":usb-hci-test-driver", |
| ":usb-hci-test-package", |
| ":usb_hci_test_bind_test", |
| ] |
| } |
| |
| fuchsia_unittest_package("usb-hci-test-package") { |
| manifest = "meta/usb-hci-test.cml" |
| deps = [ ":usb-hci-test" ] |
| |
| test_specs = { |
| environments = [ |
| { |
| dimensions = { |
| device_type = "Intel NUC Kit NUC7i5DNHE" |
| } |
| tags = [ "usb-compliance-tests" ] |
| }, |
| { |
| dimensions = { |
| device_type = "Intel NUC Kit NUC11TNHv5" |
| } |
| tags = [ "usb-compliance-tests" ] |
| }, |
| ] |
| } |
| test_type = "device" |
| } |
| |
| # Each e2e test must run in its own executable. |
| test("usb-hci-test") { |
| sources = [ "main.cc" ] |
| output_name = "usb-hci-test" |
| defines = [ |
| "EXPECTED_BITRATE=1", |
| "EXPECTED_ISOCH_PACKETS=119000", |
| ] |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.usb.hcitest:fuchsia.hardware.usb.hcitest_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/fit", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/ui/scenic/cpp", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_driver("fuchsia_driver") { |
| output_name = "usb-hci-test-driver" |
| |
| sources = [ "usb-hci-test-driver.cc" ] |
| |
| deps = [ |
| ":usb_hci_test_bind", |
| "//sdk/banjo/fuchsia.hardware.usb:fuchsia.hardware.usb_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.usb.request:fuchsia.hardware.usb.request_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.usb.hcitest:fuchsia.hardware.usb.hcitest_cpp", |
| "//sdk/lib/fit", |
| "//src/devices/lib/driver", |
| "//src/devices/usb/lib/usb", |
| "//src/devices/usb/lib/usb:peripheral", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| ] |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| } |
| |
| fuchsia_driver_component("driver") { |
| info = "driver-info.json" |
| component_name = "usb-hci-test-driver" |
| deps = [ ":fuchsia_driver" ] |
| manifest = "meta/driver.cml" |
| } |
| |
| fuchsia_driver_package("usb-hci-test-driver") { |
| driver_components = [ ":driver" ] |
| } |