blob: 52180870647662bcb49be9ae86673ae1ccfb74aa [file] [log] [blame]
# Copyright 2018 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")
declare_args() {
# Controls how many bytes of space on disk are used to persist device logs.
# Should be a string value that only contains digits.
max_log_disk_usage = "0"
log_startup_sleep = "30000"
}
rustc_binary("bin") {
name = "log_listener"
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc",
"//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc",
"//src/lib/diagnostics/selectors",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-runtime",
"//src/lib/syslog/rust:syslog-listener",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:chrono",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:regex",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
test_deps = [ "//src/lib/fuchsia" ]
sources = [ "src/main.rs" ]
}
fuchsia_shell_package("log_listener_shell") {
deps = [
":bin",
"//build/validate:non_production_tag",
]
}
executable("log_listener_return_code_test") {
testonly = true
sources = [ "log_listener_return_code_test.cc" ]
deps = [
"//sdk/lib/fdio",
"//src/lib/files",
"//src/lib/fxl/test:gtest_main",
"//src/zircon/lib/zircon",
]
}
fuchsia_component("log_listener_bin_test") {
testonly = true
manifest = "meta/log_listener_bin_test.cml"
deps = [ ":bin_test" ]
}
fuchsia_component("log_listener_return_code_test_component") {
testonly = true
component_name = "log_listener_return_code_test"
manifest = "meta/log_listener_return_code_test.cml"
deps = [ ":log_listener_return_code_test" ]
}
fuchsia_test_package("log_listener_tests") {
test_components = [
":log_listener_bin_test",
":log_listener_return_code_test_component",
]
deps = [ ":bin" ]
}
# TODO(fxbug.dev/76502): no-op, remove when dependencies stop using this.
group("log_listener") {
}
group("tests") {
testonly = true
deps = [ ":log_listener_tests" ]
}