blob: 6b618c1eed3c633aa79759012237031f0333e1e7 [file] [log] [blame]
# Copyright 2019 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")
group("rust") {
testonly = true
public_deps = [
":hermetic_tests",
":inspect-example-rust",
]
}
group("hermetic_tests") {
testonly = true
public_deps = [ ":inspect-example-rust-tests" ]
}
rustc_binary("server_bin") {
name = "inspect_server_rust"
edition = "2021"
source_root = "src/echo_server.rs"
with_unit_tests = true
deps = [
"//examples/components/routing/fidl:echo_rust",
# [START inspect_libs]
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
# [END inspect_libs]
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
test_deps = [
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
]
sources = [ "src/echo_server.rs" ]
}
fuchsia_component("server_component") {
component_name = "echo_server"
manifest = "meta/echo_server.cml"
deps = [ ":server_bin" ]
}
fuchsia_package("inspect-example-rust") {
deps = [
":server_component",
"//examples/components/routing:echo_realm",
"//examples/components/routing/rust/echo_client:echo_client_cmp",
]
}
fuchsia_unittest_package("inspect-example-rust-tests") {
deps = [ ":server_bin_test" ]
}