| # Copyright 2020 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") |
| |
| rustc_binary("battery_cli_bin") { |
| name = "battery_cli" |
| with_unit_tests = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust", |
| "//sdk/fidl/fuchsia.power.battery.test:fuchsia.power.battery.test_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:rustyline", |
| ] |
| |
| sources = [ |
| "src/commands.rs", |
| "src/main.rs", |
| ] |
| } |
| |
| # Shell components |
| fuchsia_shell_package("battery-cli") { |
| deps = [ ":battery_cli_bin" ] |
| } |
| |
| # Test components |
| fuchsia_component("battery_cli_test_driver") { |
| testonly = true |
| manifest = "meta/battery_cli_test_driver.cml" |
| deps = [ ":battery_cli_bin_test" ] |
| } |
| |
| fuchsia_component("battery_cli_tests") { |
| testonly = true |
| component_name = "battery_cli_tests" |
| manifest = "meta/battery_cli_tests.cml" |
| } |
| |
| fuchsia_test_package("battery-cli-tests") { |
| test_components = [ ":battery_cli_tests" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| deps = [ |
| ":battery_cli_test_driver", |
| "//src/power/battery-manager:battery_manager", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":battery-cli-tests" ] |
| } |