| # 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. |
| |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":package" ] |
| } |
| |
| rustc_test("driver_multiname_test") { |
| edition = "2021" |
| testonly = true |
| source_root = "test.rs" |
| sources = [ "test.rs" ] |
| deps = [ |
| ":driver.multiname.test_rust", |
| "//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_rust", |
| "//sdk/lib/device-watcher/rust", |
| "//sdk/lib/driver_test_realm/realm_builder/rust", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| } |
| |
| fuchsia_unittest_package("package") { |
| package_name = "driver_multiname_test" |
| deps = [ |
| ":driver_multiname_test", |
| ":parent_device_component", |
| "//src/devices/bus/drivers/platform:platform-bus", |
| "//src/devices/misc/drivers/test-parent", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fidl("driver.multiname.test") { |
| testonly = true |
| sources = [ "multiname.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| excluded_checks = [ "wrong-prefix-for-platform-source-library" ] |
| } |
| |
| driver_bind_rules("parent_device_bind") { |
| testonly = true |
| rules = "meta/parent_device.bind" |
| bind_output = "parent_device.bindbc" |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_driver("parent_device") { |
| testonly = true |
| output_name = "parent_device" |
| sources = [ |
| "child_device.cc", |
| "parent_device.cc", |
| ] |
| deps = [ |
| ":driver.multiname.test_cpp", |
| ":parent_device_bind", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("parent_device_component") { |
| testonly = true |
| component_name = "parent_device" |
| deps = [ ":parent_device" ] |
| info = "meta/parent_device-info.json" |
| manifest = "meta/parent_device_component.cml" |
| } |