blob: d834f8c848d8145762e514d049f8bc8d3ab8655e [file]
# 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/fuzz.gni")
import("//build/rust/rustc_fuzzer.gni")
group("tests") {
testonly = true
deps = [
":diagnostics-log-encoding-fuzzers",
":diagnostics-log-encoding-tests",
]
}
rustc_fuzzer("parse_record_fuzzer") {
edition = "2024"
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-log-encoding-fuzzers") {
rust_fuzzer_components = [ ":parse-record-fuzzer-component" ]
}
## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ##
#
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
#
#
# AUTO-GENERATED - DO NOT EDIT
#
# The targets below are auto-generated based on the targets defined in the
# BUILD.bazel file from the same directory. If you made changes to targets in
# Bazel, instead of editing this file manually, run:
#
# > fx bazel2gn
#
# Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and
# rerun bazel2gn.
import("//build/tools/bazel2gn/bazel_migration.gni")
rustc_library("rust") {
sources = [
"src/constants.rs",
"src/encode.rs",
"src/lib.rs",
"src/parse.rs",
]
crate_name = "diagnostics_log_encoding"
edition = "2024"
lint_config = "//build/config/rust/lints:clippy_warn_all"
visibility = [
":*",
"//src/developer/ffx/plugins/log/*",
"//src/diagnostics/archivist/*",
"//src/diagnostics/archivist/tests/integration/realm_factory/puppet:*",
"//src/diagnostics/lib/log-command/*",
"//src/diagnostics/validator/logs/*",
"//src/lib/diagnostics/fake-log-sink/rust/*",
"//src/lib/diagnostics/log/*",
"//src/starnix/kernel/*",
]
deps = []
deps += [
"//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust",
"//src/lib/diagnostics/log/types",
"//third_party/rust_crates:bitfield",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:zerocopy",
]
if (is_host) {
deps += []
} else {
deps += [ "//sdk/rust/zx" ]
}
}
if (is_fuchsia) {
rustc_test("rust_test") {
sources = [
"src/constants.rs",
"src/encode.rs",
"src/lib.rs",
"src/parse.rs",
]
edition = "2024"
deps = []
deps += [
"//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust",
"//src/lib/diagnostics/log/types",
"//third_party/rust_crates:bitfield",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:zerocopy",
]
if (is_host) {
deps += []
} else {
deps += [ "//sdk/rust/zx" ]
}
deps += [ "//src/lib/fuchsia" ]
output_name = "diagnostics_log_encoding_lib_test"
lint_config = "//build/config/rust/lints:clippy_warn_all"
}
}
fuchsia_unittest_package("diagnostics-log-encoding-tests") {
package_name = "diagnostics-log-encoding-tests-gn"
component_name = "diagnostics-log-encoding-tests"
deps = [ ":rust_test" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}