| # 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dynamic_offers_leaf_bind_test", |
| ":dynamic_offers_test", |
| ] |
| } |
| |
| fidl("fuchsia.offers.test") { |
| testonly = true |
| sources = [ "offers.test.fidl" ] |
| } |
| |
| driver_bind_rules("root_bind") { |
| disable_autobind = true |
| bind_output = "root.bindbc" |
| } |
| |
| fuchsia_driver("root_driver") { |
| testonly = true |
| output_name = "dynamic_offers_root" |
| sources = [ "root_driver.cc" ] |
| deps = [ |
| ":fuchsia.offers.test_llcpp", |
| ":root_bind", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_llcpp", |
| "//sdk/lib/driver2:llcpp", |
| "//sdk/lib/sys/component/cpp", |
| "//src/devices/bind/fuchsia.test:fuchsia.test_cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//zircon/system/ulib/service:service-llcpp", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_driver_component("root") { |
| testonly = true |
| manifest = "meta/root.cml" |
| deps = [ ":root_driver" ] |
| info = "root-info.json" |
| } |
| |
| driver_bind_rules("dynamic_offers_leaf_bind") { |
| rules = "leaf.bind" |
| bind_output = "leaf.bindbc" |
| tests = "leaf.bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_driver("leaf_driver") { |
| testonly = true |
| output_name = "dynamic_offers_leaf" |
| sources = [ "leaf_driver.cc" ] |
| deps = [ |
| ":dynamic_offers_leaf_bind", |
| ":fuchsia.offers.test_llcpp", |
| "//sdk/lib/driver2:llcpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//zircon/system/ulib/async:async-cpp", |
| ] |
| } |
| |
| fuchsia_driver_component("leaf") { |
| testonly = true |
| manifest = "meta/leaf.cml" |
| deps = [ ":leaf_driver" ] |
| info = "leaf-info.json" |
| } |
| |
| rustc_test("bin") { |
| edition = "2021" |
| testonly = true |
| output_name = "dynamic_offers_bin" |
| source_root = "test.rs" |
| sources = [ "test.rs" ] |
| deps = [ |
| ":fuchsia.offers.test-rustc", |
| "//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test-rustc", |
| "//sdk/lib/driver_test_realm/realm_builder/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| cmc_merge("realm.cml") { |
| sources = [ |
| "//sdk/lib/driver_test_realm/meta/driver_test_realm.cml", |
| "meta/realm.shard.cml", |
| ] |
| } |
| |
| fuchsia_test_component("realm") { |
| manifest = "${target_out_dir}/realm.cml" |
| restricted_features = [ "dynamic_offers" ] |
| manifest_deps = [ ":realm.cml" ] |
| } |
| |
| fuchsia_unittest_package("dynamic_offers_test") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":bin", |
| ":leaf", |
| ":realm", |
| ":root", |
| "//src/devices/bin/driver_host2:component", |
| ] |
| } |