blob: 10d15ad4b23658a435f56faea6b601d6d0866c0e [file] [log] [blame]
# 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 = [
":driver-runtime-leaf-bind_test",
":v2-driver-runtime-test",
]
}
fidl("fuchsia.runtime.test") {
testonly = true
sources = [ "runtime.test.fidl" ]
public_deps = [ "//zircon/vdso/zx" ]
visibility = [ ":*" ]
}
driver_bind_rules("root_bind") {
disable_autobind = true
bind_output = "root.bindbc"
}
fuchsia_driver("root-driver") {
testonly = true
output_name = "driver-runtime-root"
sources = [ "root-driver.cc" ]
deps = [
":fuchsia.runtime.test_llcpp",
":root_bind",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_llcpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_driver",
"//sdk/lib/driver2:llcpp",
"//sdk/lib/driver_runtime",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//sdk/lib/sys/component/llcpp",
"//src/devices/bind/fuchsia.test:fuchsia.test_cpp",
"//src/devices/lib/driver:driver_runtime",
"//zircon/system/ulib/service:service-llcpp",
]
}
fuchsia_driver_component("root") {
testonly = true
manifest = "meta/root.cml"
deps = [ ":root-driver" ]
info = "root-info.json"
}
driver_bind_rules("driver-runtime-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 = "driver-runtime-leaf"
sources = [ "leaf-driver.cc" ]
deps = [
":driver-runtime-leaf-bind",
":fuchsia.runtime.test_driver",
":fuchsia.runtime.test_llcpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_driver",
"//sdk/lib/driver2:llcpp",
"//sdk/lib/driver_runtime",
"//sdk/lib/driver_runtime:driver_runtime_cpp",
"//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 = "driver-runtime-bin"
source_root = "test.rs"
sources = [ "test.rs" ]
deps = [
":fuchsia.runtime.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("v2-driver-runtime-test") {
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
deps = [
":bin",
":leaf",
":realm",
":root",
"//src/devices/bin/driver_host2:component",
]
}