| # Copyright 2023 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/rust/rustc_test.gni") |
| import("//build/test.gni") |
| |
| fidl("fuchsia.rebind.test") { |
| testonly = true |
| sources = [ "rebind.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| driver_bind_rules("child_bind") { |
| testonly = true |
| rules = "rebind_child.bind" |
| bind_output = "rebind_child.bindbc" |
| } |
| |
| fuchsia_driver("child_driver") { |
| testonly = true |
| output_name = "rebind_child" |
| sources = [ "rebind_child.cc" ] |
| deps = [ |
| ":child_bind", |
| ":fuchsia.rebind.test_cpp", |
| "//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/compat/cpp:symbols", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/devfs/cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("child_driver_component") { |
| testonly = true |
| component_name = "rebind_child" |
| manifest = "meta/rebind_child.cml" |
| deps = [ ":child_driver" ] |
| info = "component-info.json" |
| } |
| |
| driver_bind_rules("parent_bind") { |
| testonly = true |
| rules = "rebind_parent.bind" |
| bind_output = "rebind_parent.bindbc" |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_driver("parent_driver") { |
| testonly = true |
| output_name = "rebind_parent" |
| sources = [ "rebind_parent.cc" ] |
| deps = [ |
| ":fuchsia.rebind.test_cpp", |
| ":parent_bind", |
| "//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/compat/cpp:symbols", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/devfs/cpp", |
| "//sdk/lib/driver/legacy-bind-constants", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("parent_driver_component") { |
| testonly = true |
| component_name = "rebind_parent" |
| manifest = "meta/rebind_parent.cml" |
| deps = [ ":parent_driver" ] |
| info = "component-info.json" |
| } |
| |
| group("drivers") { |
| testonly = true |
| deps = [ |
| ":child_driver_component", |
| ":parent_driver_component", |
| ] |
| } |
| |
| rustc_test("rebind_test") { |
| edition = "2021" |
| testonly = true |
| source_root = "test.rs" |
| sources = [ "test.rs" ] |
| deps = [ |
| ":fuchsia.rebind.test_rust", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.device.fs:fuchsia.device.fs_rust", |
| "//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_rust", |
| "//sdk/lib/device-watcher/rust", |
| "//sdk/lib/driver_test_realm/realm_builder/rust", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| ] |
| } |
| |
| fuchsia_unittest_package("package") { |
| package_name = "rebind_test" |
| deps = [ |
| ":child_driver_component", |
| ":parent_driver_component", |
| ":rebind_test", |
| "//src/devices/misc/drivers/test-parent", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":package" ] |
| } |