blob: 7bc5616c2b287608cd09894d7b197491d2e1bd25 [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_rust",
"//sdk/fidl/fuchsia.diagnostics.host:fuchsia.diagnostics.host_rust",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust",
"//src/developer/ffx/lib/writer:lib",
"//src/diagnostics/lib/log-command",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-runtime",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
]
sources = [ "src/main.rs" ]
}
fuchsia_shell_package("log_listener_shell_pkg") {
package_name = "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" ]
}
group("tests") {
testonly = true
deps = [ ":log_listener_tests" ]
}