| # Copyright 2021 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") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":package" ] |
| } |
| |
| group("drivers") { |
| testonly = true |
| deps = [ ":component" ] |
| } |
| |
| driver_bind_rules("bind") { |
| rules = "meta/init-test.bind" |
| bind_output = "init-test.bindbc" |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_cc_driver("driver") { |
| output_name = "init-test" |
| sources = [ "init-test.cc" ] |
| deps = [ |
| ":bind", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("component") { |
| component_name = "init-test" |
| deps = [ ":driver" ] |
| info = "meta/init-test-info.json" |
| manifest = "meta/component.cml" |
| } |
| |
| rustc_test("init-test") { |
| edition = "2021" |
| testonly = true |
| source_root = "test.rs" |
| sources = [ "test.rs" ] |
| deps = [ |
| "//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", |
| ] |
| } |
| |
| fuchsia_unittest_package("package") { |
| package_name = "ddk-init-test" |
| deps = [ |
| ":component", |
| ":init-test", |
| "//src/devices/misc/drivers/test-parent", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |