| # Copyright 2021 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. |
| |
| assert(is_fuchsia, "These targets are only compiled in the fuchsia toolchain.") |
| |
| # [START imports] |
| import("//build/components.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| # [END imports] |
| |
| # [START example_snippet] |
| # [START executable] |
| rustc_test("bin") { |
| name = "echo_integration_test_rust" |
| edition = "2021" |
| |
| deps = [ |
| "//examples/components/routing/fidl:echo_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| } |
| |
| # [END executable] |
| |
| # [START component] |
| fuchsia_component("echo_integration_test_component") { |
| testonly = true |
| component_name = "echo_integration_test" |
| manifest = "meta/echo_integration_test.cml" |
| deps = [ ":bin" ] |
| } |
| |
| # [END component] |
| |
| # [START test_package] |
| fuchsia_test_package("echo_integration_test_rust") { |
| test_components = [ ":echo_integration_test_component" ] |
| deps = [ "//examples/components/routing/rust/echo_server:echo_server_cmp" ] |
| } |
| |
| # [END test_package] |
| |
| # [END example_snippet] |
| |
| fuchsia_test_component("subpackaged_echo_integration_test_rust_component") { |
| manifest = "meta/subpackaged_echo_integration_test.cml" |
| component_name = "default" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_test_package("subpackaged_echo_integration_test_rust") { |
| subpackages = [ "//examples/components/routing/rust/echo_server" ] |
| test_components = [ ":subpackaged_echo_integration_test_rust_component" ] |
| } |
| |
| group("hermetic_tests") { |
| testonly = true |
| deps = [ |
| ":echo_integration_test_rust", |
| ":subpackaged_echo_integration_test_rust", |
| ] |
| } |