| # 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") |
| |
| bind_rules("usb_peripheral_test-bind") { |
| rules = "usb_peripheral_test.bind" |
| output = "usb_peripheral_test-bind.h" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.usb" ] |
| } |
| |
| if (is_fuchsia) { |
| import("//build/config/fuchsia/rules.gni") |
| |
| driver_module("usb-peripheral-test") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ "driver.cc" ] |
| deps = [ |
| ":usb_peripheral_test-bind", |
| "//sdk/banjo/ddk.protocol.usb", |
| "//sdk/banjo/ddk.protocol.usb.function", |
| "//sdk/banjo/ddk.protocol.usb.request", |
| "//src/devices/lib/driver", |
| "//src/devices/usb/lib/usb", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":tests($host_toolchain)", |
| ":usb_peripheral_test-bind_test", |
| ] |
| } |
| } else if (current_os == "linux") { |
| import("//build/test.gni") |
| |
| test("usb-peripheral-test") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| output_name = "usb-peripheral-test" |
| sources = [ "test.cc" ] |
| deps = [ |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| "//zircon/third_party/ulib/usbhost", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":usb-peripheral-test" ] |
| } |
| } else { |
| group("tests") { |
| } |
| } |