| # 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/rust/rustc_library.gni") |
| import("//src/sys/build/components.gni") |
| |
| group("log-stats") { |
| testonly = true |
| deps = [ |
| ":package", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":log-stats-tests" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "log-stats" |
| manifest = "meta/log-stats.cml" |
| deps = [ "//src/diagnostics/launcher:bin" ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "log-stats" |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_component("component-v1") { |
| component_name = "log-stats" |
| manifest = "meta/log-stats.cmx" |
| deps = [ "//src/diagnostics/launcher:bin" ] |
| } |
| |
| rustc_library("lib") { |
| name = "log-stats" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics-rustc", |
| "//src/diagnostics/archivist:lib", |
| "//src/diagnostics/control:controller-rustc", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:proptest" ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/metric_logger.rs", |
| "src/stats.rs", |
| ] |
| } |
| |
| fuchsia_unittest_component("log-stats-unit-tests") { |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_component("log-stats-integration-tests") { |
| testonly = true |
| manifest = "meta/integration-tests.cmx" |
| deps = [ |
| ":component-v1", |
| ":test-bin", |
| ] |
| } |
| |
| fuchsia_test_package("log-stats-tests") { |
| test_components = [ |
| ":log-stats-unit-tests", |
| ":log-stats-integration-tests", |
| ] |
| } |
| |
| rustc_test("test-bin") { |
| testonly = true |
| name = "log_stats_integration_tests" |
| deps = [ |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/diagnostics/testing/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| |
| source_root = "tests/integration.rs" |
| sources = [ "tests/integration.rs" ] |
| } |