blob: 7214fb1bcadd65abb9fec926001d66f3897cc1de [file] [log] [blame]
# 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 = [ ":services_test" ]
}
fidl("fuchsia.services.test") {
testonly = true
sources = [ "services.test.fidl" ]
}
driver_bind_rules("root_bind") {
disable_autobind = true
bind_output = "root.bindbc"
}
fuchsia_driver("root_driver") {
testonly = true
output_name = "services_root"
sources = [ "root_driver.cc" ]
deps = [
":fuchsia.services.test_llcpp",
":root_bind",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_llcpp",
"//sdk/lib/driver2:llcpp",
"//sdk/lib/sys/component/llcpp",
"//src/devices/lib/driver:driver_runtime",
]
}
fuchsia_driver_component("root") {
testonly = true
manifest = "meta/root.cml"
deps = [ ":root_driver" ]
info = "root-info.json"
}
rustc_test("bin") {
edition = "2021"
testonly = true
output_name = "services_bin"
source_root = "test.rs"
sources = [ "test.rs" ]
deps = [
":fuchsia.services.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",
"//src/lib/fuchsia-fs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//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("services_test") {
deps = [
":bin",
":realm",
":root",
"//src/devices/bin/driver_host2:component",
]
}