blob: 24cc17b1ca2c3d6707f1f480c4eca42ea1919bf5 [file] [log] [blame]
# Copyright 2024 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.
assert(is_fuchsia, "These targets are only compiled in the fuchsia toolchain.")
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
import("//build/rust/rustc_test.gni")
rustc_test("test_bin") {
name = "dynamic_create_child_test"
edition = "2021"
deps = [
"//examples/components/routing/fidl:echo_rust",
"//sdk/fidl/fuchsia.component:fuchsia.component_rust",
"//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust",
"//sdk/fidl/fuchsia.component.sandbox:fuchsia.component.sandbox_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/sandbox",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
source_root = "src/test.rs"
sources = [ "src/test.rs" ]
}
rustc_binary("bin") {
name = "dynamic_create_child_child"
edition = "2021"
deps = [
"//examples/components/routing/fidl:echo_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:log",
]
source_root = "src/child.rs"
sources = [ "src/child.rs" ]
}
fuchsia_component("dynamic-create-child-child") {
manifest = "meta/dynamic_create_child_child.cml"
deps = [ ":bin" ]
}
fuchsia_test_component("dynamic-create-child-test") {
manifest = "meta/dynamic_create_child_test.cml"
deps = [ ":test_bin" ]
}
# Run with `fx test dynamic-create-child-example`
fuchsia_test_package("tests") {
package_name = "dynamic-create-child-example"
test_components = [ ":dynamic-create-child-test" ]
deps = [ ":dynamic-create-child-child" ]
}