| # 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. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":inspect_validator_test_cpp", |
| ":inspect_validator_test_rust", |
| ":inspect_validator_unittest", |
| ] |
| } |
| |
| rustc_library("inspect_validator") { |
| testonly = true |
| edition = "2021" |
| with_unit_tests = true |
| |
| sources = [ |
| "src/data.rs", |
| "src/data/fetch.rs", |
| "src/data/scanner.rs", |
| "src/lib.rs", |
| "src/macros.rs", |
| "src/metrics.rs", |
| "src/puppet.rs", |
| "src/results.rs", |
| "src/runner.rs", |
| "src/trials.rs", |
| ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/diagnostics/validator/inspect/fidl:validate_rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/inspect/format/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-component", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:base64", |
| "//third_party/rust_crates:difference", |
| "//third_party/rust_crates:num-derive", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| } |
| |
| # Unit tests for validator_bin (not the validation tests themselves) |
| fuchsia_unittest_package("inspect_validator_unittest") { |
| deps = [ ":inspect_validator_test" ] |
| } |
| |
| # The program that actually executes the validator tests. |
| rustc_test("validator_bin") { |
| name = "validator" |
| edition = "2021" |
| source_root = "src/main.rs" |
| |
| sources = [ "src/main.rs" ] |
| |
| deps = [ |
| ":inspect_validator", |
| "//src/lib/fuchsia", |
| ] |
| } |
| |
| # The parent component of #validator_component and #puppet. Provides the necessary topology. |
| fuchsia_test_component("inspect_validator_test_executor") { |
| component_name = "test" |
| manifest = "meta/test.cml" |
| } |
| |
| # Pre-compiled manifest for #validator_component |
| fuchsia_component_manifest("validator_component_manifest") { |
| testonly = true |
| component_name = "validator" |
| manifest = "meta/validator.cml" |
| } |
| |
| # Component containing the test cases. |
| fuchsia_test_component("validator_component") { |
| cm_label = ":validator_component_manifest" |
| deps = [ ":validator_bin" ] |
| } |
| |
| fuchsia_package("validator") { |
| testonly = true |
| package_name = "inspect_validator" |
| deps = [ ":validator_component" ] |
| } |
| |
| # The per-language test packages are below |
| |
| fuchsia_test_package("inspect_validator_test_rust") { |
| subpackages = [ ":validator" ] |
| renameable_subpackages = [ |
| { |
| name = "puppet" |
| package = "//src/diagnostics/validator/inspect/lib/rust" |
| }, |
| ] |
| test_components = [ ":inspect_validator_test_executor" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fuchsia_test_package("inspect_validator_test_cpp") { |
| subpackages = [ ":validator" ] |
| renameable_subpackages = [ |
| { |
| name = "puppet" |
| package = "//src/diagnostics/validator/inspect/lib/cpp" |
| }, |
| ] |
| test_components = [ ":inspect_validator_test_executor" ] |
| } |