| # Copyright 2020 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/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| group("logs-budget") { |
| testonly = true |
| deps = [ ":package" ] |
| } |
| |
| rustc_binary("test") { |
| testonly = true |
| output_name = "logs_budget" |
| |
| deps = [ |
| ":fidl-rustc", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/diagnostics/archivist:lib", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("component") { |
| testonly = true |
| component_name = "test-logs-budget" |
| manifest = "meta/test-logs-budget.cmx" |
| deps = [ ":test" ] |
| } |
| |
| fuchsia_component("archivist-with-small-caches") { |
| testonly = true |
| manifest = "//src/diagnostics/archivist/meta/archivist-for-embedding.cmx" |
| deps = [ |
| ":small-caches-archivist-config", |
| "//src/diagnostics/archivist:bin", |
| ] |
| } |
| |
| resource("small-caches-archivist-config") { |
| sources = [ "config/small-caches-config.json" ] |
| outputs = "data/embedding-config.json" |
| } |
| |
| fidl("fidl") { |
| testonly = true |
| name = "test.logs.budget" |
| sources = [ "fidl/socket_puppet.test.fidl" ] |
| } |
| |
| rustc_binary("puppet") { |
| testonly = true |
| name = "socket_puppet" |
| source_root = "src/puppet.rs" |
| |
| deps = [ |
| ":fidl-rustc", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "src/puppet.rs" ] |
| } |
| |
| puppet_ids = [ |
| 0, |
| 1, |
| 2, |
| 3, |
| 4, |
| ] |
| puppets = [] |
| foreach(puppet_id, puppet_ids) { |
| puppet_name = "socket-puppet" + puppet_id |
| puppets += [ ":$puppet_name" ] |
| fuchsia_component(puppet_name) { |
| testonly = true |
| manifest = "meta/socket-puppet.cmx" |
| deps = [ ":puppet" ] |
| } |
| } |
| |
| fuchsia_test_package("package") { |
| package_name = "test-logs-budget" |
| test_components = [ ":component" ] |
| deps = [ ":archivist-with-small-caches" ] + puppets |
| } |