blob: c28957edabe6d66e2882563c0a504fe815dd6331 [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")
group("hermetic_tests") {
testonly = true
deps = [ ":dictionary-examples" ]
}
rustc_test("bin") {
name = "dynamic_dictionary"
edition = "2021"
deps = [
"//examples/components/routing/fidl:echo_rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:log",
]
sources = [ "src/lib.rs" ]
}
rustc_binary("provider_bin") {
name = "dynamic_dictionary_provider"
edition = "2021"
deps = [
"//examples/components/routing/fidl:echo_rust",
"//sdk/fidl/fuchsia.component.sandbox:fuchsia.component.sandbox_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/sandbox",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
]
source_root = "provider/src/main.rs"
sources = [ "provider/src/main.rs" ]
}
fuchsia_component("dynamic-dictionary-provider") {
manifest = "meta/dynamic_dictionary_provider.cml"
deps = [ ":provider_bin" ]
restricted_features = [ "dynamic_dictionaries" ]
}
fuchsia_test_component("dynamic-dictionary-example") {
manifest = "meta/dynamic_dictionary.cml"
deps = [ ":bin" ]
}
# Run with `fx test dictionary-examples`
fuchsia_test_package("dictionary-examples") {
test_components = [ ":dynamic-dictionary-example" ]
deps = [ ":dynamic-dictionary-provider" ]
}