blob: 867574e52c1d38cda45d6fc26d1239fb711a289e [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/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
rustc_library("lib") {
name = "inspect_runtime"
version = "0.1.0"
edition = "2021"
with_unit_tests = true
# Restrict visibility to local targets. Clients looking to use the inspect_runtime library
# should depend on `:rust` or, in rare circumstances, `:unchecked_includes`.
visibility = [ ":*" ]
deps = [
"//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/rust/zx",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component/client",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:pin-project",
]
test_deps = [
"//src/lib/diagnostics/hierarchy/rust",
"//src/lib/diagnostics/reader/rust",
"//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component-test",
"//third_party/rust_crates:assert_matches",
# TODO(https://fxbug.dev/42161852): Remove this dep during post-migration cleanup.
"//src/sys/lib/component-events",
]
sources = [
"src/lib.rs",
"src/service.rs",
]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
fuchsia_unittest_package("inspect-runtime-tests") {
manifest = "meta/inspect_runtime_lib_test.cml"
deps = [
":inspect_test_component",
":inspect_test_component_default_config",
":lib_test",
]
}
rustc_binary("inspect_test_component_bin") {
testonly = true
edition = "2021"
source_root = "test/main.rs"
deps = [
":inspect_test_component_config_bindings",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:futures",
]
sources = [ "test/main.rs" ]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
fuchsia_component_manifest("inspect_test_component_manifest") {
component_name = "inspect_test_component"
manifest = "meta/inspect_test_component.cml"
}
fuchsia_structured_config_values("inspect_test_component_default_config") {
cm_label = ":inspect_test_component_manifest"
values = {
publish_n_trees = 1
}
}
fuchsia_structured_config_rust_lib("inspect_test_component_config_bindings") {
cm_label = ":inspect_test_component_manifest"
}
fuchsia_component("inspect_test_component") {
testonly = true
deps = [ ":inspect_test_component_bin" ]
cm_label = ":inspect_test_component_manifest"
}
group("inspect_test_component_default") {
testonly = true
public_deps = [
":inspect_test_component",
":inspect_test_component_default_config",
]
}
group("tests") {
testonly = true
deps = [ ":inspect-runtime-tests" ]
}
group("rust") {
public_deps = [
":lib",
"//sdk/lib/inspect:client_includes",
]
}
group("unchecked_includes") {
public_deps = [ ":lib" ]
}