| # 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. |
| |
| # This file was generated by the `fx create` command. The template |
| # is located at `//tools/create/templates/component-v1/BUILD.gn.tmpl-rust`. |
| # If you find something broken, we are eager to review fixes. |
| |
| import("//build/component/config.gni") |
| import("//build/components.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| group("utc-time") { |
| testonly = true |
| deps = [ ":tests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":utc-time-tests", |
| "//src/sys/component_manager:component-manager", |
| ] |
| } |
| |
| fidl("componentmanager.test") { |
| testonly = true |
| sources = [ "componentmanager.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| rustc_binary("maintainer_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "maintainer.rs" |
| name = "utc_time_maintainer_bin" |
| deps = [ |
| ":componentmanager.test-rustc", |
| "//sdk/fidl/fuchsia.time:fuchsia.time-rustc", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/test_util", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "maintainer.rs" ] |
| } |
| |
| rustc_binary("time_client_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "time_client.rs" |
| name = "utc_time_client_bin" |
| deps = [ |
| ":componentmanager.test-rustc", |
| "//sdk/fidl/fuchsia.time:fuchsia.time-rustc", |
| "//src/lib/fuchsia", |
| "//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:tracing", |
| ] |
| |
| sources = [ "time_client.rs" ] |
| } |
| |
| rustc_test("integration_test_bin") { |
| edition = "2021" |
| source_root = "integration_test.rs" |
| name = "utc_time_integration_test" |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/testing:test_utils_lib", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "integration_test.rs" ] |
| } |
| |
| fuchsia_component("integration-test-component") { |
| testonly = true |
| manifest = "meta/integration-test.cmx" |
| deps = [ ":integration_test_bin" ] |
| } |
| |
| fuchsia_component("maintainer-component") { |
| testonly = true |
| manifest = "meta/maintainer.cml" |
| deps = [ ":maintainer_bin" ] |
| } |
| |
| fuchsia_component("time-client") { |
| testonly = true |
| manifest = "meta/time_client.cml" |
| deps = [ ":time_client_bin" ] |
| } |
| |
| fuchsia_component("realm") { |
| testonly = true |
| manifest = "meta/realm.cml" |
| } |
| |
| component_config("cm_config") { |
| sources = [ "cm_config.json5" ] |
| } |
| |
| resource("cm_config_resource") { |
| sources = [ "$target_gen_dir/cm_config" ] |
| outputs = [ "data/cm_config" ] |
| deps = [ ":cm_config" ] |
| } |
| |
| fuchsia_component("component-manager") { |
| deps = [ |
| ":cm_config_resource", |
| "//src/sys/component_manager:bin", |
| ] |
| component_name = "component_manager" |
| manifest = |
| rebase_path("//src/sys/component_manager/meta/component_manager.cmx") |
| } |
| |
| # Run with `fx test utc-time-tests`. |
| fuchsia_test_package("utc-time-tests") { |
| test_components = [ ":integration-test-component" ] |
| deps = [ |
| ":component-manager", |
| ":maintainer-component", |
| ":realm", |
| ":time-client", |
| ] |
| } |