| # 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":runtime-protocol-leaf-bind_test", |
| ":runtime-protocol-test", |
| ":runtime-protocol-test-rust", |
| ] |
| } |
| |
| fidl("fuchsia.runtime.test") { |
| testonly = true |
| sources = [ "runtime.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| contains_drivers = true |
| |
| visibility = [ ":*" ] |
| } |
| |
| driver_bind_rules("root_bind") { |
| disable_autobind = true |
| bind_output = "root.bindbc" |
| } |
| |
| fuchsia_cc_driver("root-driver") { |
| testonly = true |
| output_name = "runtime-protocol-root" |
| sources = [ "root-driver.cc" ] |
| deps = [ |
| ":fuchsia.runtime.test_cpp", |
| ":root_bind", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp", |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//src/devices/bind/fuchsia:fuchsia_cpp", |
| "//src/devices/bind/fuchsia.test:fuchsia.test_cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/storage/lib/vfs/cpp", |
| ] |
| } |
| |
| fuchsia_driver_component("root") { |
| testonly = true |
| manifest = "meta/root.cml" |
| deps = [ ":root-driver" ] |
| info = "meta/root-info.json" |
| } |
| |
| driver_bind_rules("runtime-protocol-leaf-bind") { |
| rules = "meta/leaf.bind" |
| bind_output = "leaf.bindbc" |
| tests = "meta/leaf.bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.test" ] |
| } |
| |
| fuchsia_cc_driver("leaf-driver") { |
| testonly = true |
| output_name = "runtime-protocol-leaf" |
| sources = [ "leaf-driver.cc" ] |
| deps = [ |
| ":fuchsia.runtime.test_cpp", |
| ":runtime-protocol-leaf-bind", |
| "//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/lib/fidl/contrib/fpromise", |
| ] |
| } |
| |
| fuchsia_driver_component("leaf") { |
| testonly = true |
| manifest = "meta/leaf.cml" |
| deps = [ ":leaf-driver" ] |
| info = "meta/leaf-info.json" |
| } |
| |
| rustc_test("bin") { |
| edition = "2024" |
| testonly = true |
| output_name = "runtime-protocol-bin" |
| source_root = "test.rs" |
| sources = [ "test.rs" ] |
| deps = [ |
| ":fuchsia.runtime.test_rust", |
| "//sdk/fidl/fuchsia.driver.test:fuchsia.driver.test_rust", |
| "//sdk/lib/driver_test_realm/realm_builder/rust:rust_no_driver_manager", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| ] |
| } |
| |
| fuchsia_unittest_package("runtime-protocol-test") { |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":bin", |
| ":leaf", |
| ":root", |
| "//sdk/lib/driver_test_realm:driver_manager_test", |
| "//sdk/lib/driver_test_realm:driver_test_realm_component", |
| ] |
| } |
| |
| fuchsia_unittest_package("runtime-protocol-test-rust") { |
| package_name = "runtime-protocol-test-rustdm" |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":bin", |
| ":leaf", |
| ":root", |
| "//sdk/lib/driver_test_realm:driver_manager_test_rust", |
| "//sdk/lib/driver_test_realm:driver_test_realm_component", |
| ] |
| } |