| # 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/fidl/fidl.gni") |
| import("//build/fuzz.gni") |
| import("//build/rust/rustc_fuzzer.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":diagnostics-stream-fuzzers", |
| ":diagnostics-stream-tests", |
| ] |
| } |
| |
| rustc_library("rust") { |
| name = "diagnostics_log_encoding" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.diagnostics.stream:fuchsia.diagnostics.stream_rust", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:bitfield", |
| "//third_party/rust_crates:nom", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:tracing-core", |
| "//third_party/rust_crates:tracing-log", |
| "//third_party/rust_crates:tracing-subscriber", |
| ] |
| |
| visibility = [ |
| "//src/diagnostics/archivist:*", |
| "//src/diagnostics/archivist/tests/integration/realm_factory/puppet:*", |
| "//src/diagnostics/validator/logs/*", |
| "//src/lib/diagnostics/log/*", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:once_cell", |
| "//third_party/rust_crates:tracing-subscriber", |
| ] |
| |
| sources = [ |
| "src/encode.rs", |
| "src/lib.rs", |
| "src/parse.rs", |
| ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("diagnostics-stream-tests") { |
| deps = [ ":rust_test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| rustc_fuzzer("parse_record_fuzzer") { |
| edition = "2021" |
| deps = [ |
| ":rust", |
| "//src/lib/fuzzing/rust:fuzz", |
| ] |
| source_root = "src/fuzzer.rs" |
| |
| sources = [ "src/fuzzer.rs" ] |
| } |
| |
| fuchsia_fuzzer_component("parse-record-fuzzer-component") { |
| manifest = "meta/parse_record_fuzzer.cml" |
| deps = [ ":parse_record_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("diagnostics-stream-fuzzers") { |
| rust_fuzzer_components = [ ":parse-record-fuzzer-component" ] |
| } |