| # Copyright 2022 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_test.gni") |
| import("//sdk/ctf/build/ctf.gni") |
| |
| rustc_test("realm_integration_test_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "src/integration_test.rs" |
| sources = [ "src/integration_test.rs" ] |
| deps = [ |
| "//examples/components/routing/fidl:echo_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| ] |
| } |
| |
| rustc_test("realm_namespace_test_bin") { |
| edition = "2021" |
| testonly = true |
| source_root = "src/namespace_test.rs" |
| sources = [ "src/namespace_test.rs" ] |
| deps = [ |
| "//examples/components/routing/fidl:echo_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| ] |
| } |
| |
| fuchsia_component("no_program") { |
| testonly = true |
| manifest = "meta/no_program.cml" |
| } |
| |
| fuchsia_test_component("realm_integration_test") { |
| manifest = "meta/realm_integration_test.cml" |
| deps = [ ":realm_integration_test_bin" ] |
| } |
| |
| fuchsia_test_component("realm_namespace_test") { |
| manifest = "meta/realm_namespace_test.cml" |
| deps = [ ":realm_namespace_test_bin" ] |
| } |
| |
| template("ctf_or_integration_test") { |
| FUCHSIA_TEST_NAMES = [ |
| "realm_integration_test", |
| "realm_namespace_test", |
| ] |
| DEPS = [ |
| ":no_program", |
| "//src/sys/component_manager/testing/echo_server", |
| |
| # https://fxbug.dev/42052321: Dep included for affected tests presubmit |
| "//src/sys/component_manager:component-manager-realm-builder-cmp", |
| ] |
| if (defined(invoker.ctf) && invoker.ctf) { |
| ctf_fuchsia_package(target_name) { |
| testonly = true |
| package_name = target_name |
| deps = DEPS |
| test_component_names = [] |
| foreach(fuchsia_test_name, FUCHSIA_TEST_NAMES) { |
| test_component_names += [ "${fuchsia_test_name}" ] |
| deps += [ ":${fuchsia_test_name}" ] |
| } |
| } |
| } else { |
| fuchsia_test_package(target_name) { |
| deps = DEPS |
| test_components = [] |
| foreach(fuchsia_test_name, FUCHSIA_TEST_NAMES) { |
| test_components += [ ":${fuchsia_test_name}" ] |
| } |
| } |
| } |
| } |
| |
| ctf_or_integration_test("realm_integration_tests") { |
| ctf = false |
| } |
| |
| ctf_or_integration_test("realm_integration_tests-ctf") { |
| ctf = true |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":realm_integration_tests" ] |
| } |
| |
| group("ctf-tests") { |
| testonly = true |
| deps = [ ":realm_integration_tests-ctf_archive" ] |
| } |