| # 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/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//src/sys/build/components.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" ] |
| } |
| |
| rustc_binary("consumer_bin") { |
| testonly = true |
| source_root = "consumer.rs" |
| name = "utc_time_consumer_bin" |
| deps = [ |
| ":componentmanager.test-rustc", |
| "//sdk/fidl/fuchsia.time:fuchsia.time-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:log", |
| ] |
| } |
| |
| rustc_test("integration_test_bin") { |
| source_root = "integration_test.rs" |
| name = "utc_time_integration_test" |
| deps = [ |
| ":componentmanager.test-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/component_manager/tests:test_utils_lib", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| ] |
| } |
| |
| fuchsia_component("integration-test-component") { |
| testonly = true |
| manifest = "meta/integration-test.cmx" |
| deps = [ ":integration_test_bin" ] |
| } |
| |
| fuchsia_component("consumer-component") { |
| testonly = true |
| manifest = "meta/consumer.cml" |
| deps = [ ":consumer_bin" ] |
| } |
| |
| # Run with `fx test utc-time-tests`. |
| fuchsia_test_package("utc-time-tests") { |
| test_components = [ ":integration-test-component" ] |
| deps = [ ":consumer-component" ] |
| } |