| # Copyright 2024 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") |
| |
| group("rust") { |
| testonly = true |
| deps = [ ":power_config_client_bin" ] |
| } |
| |
| fuchsia_component_manifest("power_config_client_manifest") { |
| manifest = "meta/power_config_client.cml" |
| component_name = "power_config_client" |
| } |
| |
| fuchsia_structured_config_rust_lib("power_config_client_config") { |
| cm_label = ":power_config_client_manifest" |
| } |
| |
| rustc_binary("power_config_client_bin") { |
| name = "power_config_client" |
| edition = "2021" |
| testonly = true |
| source_root = "src/power_config_client.rs" |
| sources = [ "src/power_config_client.rs" ] |
| deps = [ |
| ":power_config_client_config", |
| "//examples/power/suspend_config/fidl:test.configexample_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| } |
| |
| fuchsia_component("power_config_client_component") { |
| component_name = "power_config_client" |
| manifest = "meta/power_config_client.cml" |
| deps = [ ":power_config_client_bin" ] |
| testonly = true |
| } |
| |
| fuchsia_package("power_config_client_package") { |
| package_name = "power_config_client_package" |
| testonly = true |
| deps = [ ":power_config_client_component" ] |
| } |
| |
| rustc_test("power_config_client_integration_test") { |
| name = "power_config_client_integration_test" |
| edition = "2021" |
| source_root = "src/power_config_client_integration_test.rs" |
| sources = [ "src/power_config_client_integration_test.rs" ] |
| deps = [ |
| "//examples/power/suspend_config/fidl:test.configexample_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component-test", |
| "//src/sys/lib/cm_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:test-case", |
| ] |
| } |
| |
| fuchsia_component("power_config_client_test_component") { |
| component_name = "power_config_client_test" |
| manifest = "meta/power_config_client_test.cml" |
| deps = [ ":power_config_client_integration_test" ] |
| testonly = true |
| } |
| |
| fuchsia_test_package("power_config_client_test") { |
| test_components = [ ":power_config_client_test_component" ] |
| subpackages = [ ":power_config_client_package" ] |
| } |
| |
| group("tests") { |
| deps = [ ":power_config_client_test" ] |
| testonly = true |
| } |