| # 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/rust/rustc_binary.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("driver-index") { |
| deps = [ ":package" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":driver-index-unittests" ] |
| } |
| |
| rustc_binary("bin") { |
| name = "driver-index" |
| |
| # Generates a GN target for unit-tests with the label `bin_test`, and |
| # a binary named `driver_index_bin_test`. |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework-rustc", |
| "//src/devices/bind/debugger:lib", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "driver-index" |
| manifest = "meta/driver-index.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "driver-index" |
| deps = [ ":component" ] |
| } |
| |
| bind_rules("test-bind") { |
| rules = "test.bind" |
| output = "my-test-driver-url.cm" |
| output_bytecode = true |
| } |
| |
| # Run with `fx test driver-index-unittests`. |
| fuchsia_unittest_package("driver-index-unittests") { |
| manifest = "meta/driver-index-unittests.cml" |
| deps = [ |
| ":bin_test", |
| ":test-bind", |
| ] |
| } |