| # Copyright 2025 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/fuchsia_unittest_package.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_staticlib.gni") |
| |
| _sources = [ "src/lib.rs" ] |
| _deps = [ |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//src/diagnostics/lib/ring-buffer", |
| "//src/lib/diagnostics/log/message/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| rustc_library("rust") { |
| name = "fake-log-sink" |
| with_unit_tests = true |
| testonly = true |
| edition = "2021" |
| |
| sources = _sources |
| deps = _deps |
| test_deps = [ |
| "//sdk/rust/zx", |
| "//src/lib/diagnostics/log/encoding/rust", |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| rustc_staticlib("rust_ffi") { |
| testonly = true |
| edition = "2024" |
| features = [ "ffi" ] |
| visibility = [ |
| ":*", |
| "//src/lib/diagnostics/fake-log-sink/cpp:*", |
| "//src/lib/diagnostics/log/message/rust/cpp-log-decoder:*", |
| ] |
| public = [ "fake_log_sink.h" ] |
| sources = _sources |
| deps = _deps + [ |
| "//sdk/rust/zx", |
| "//src/lib/diagnostics/log/message/rust/cpp-log-decoder:lib", |
| ] |
| } |
| |
| fuchsia_unittest_package("fake-log-sink-tests") { |
| manifest = "meta/fake-log-sink-test.cml" |
| deps = [ ":rust_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fake-log-sink-tests" ] |
| } |