| # Copyright 2023 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/fidl/fidl.gni") |
| |
| executable("bin") { |
| testonly = true |
| output_name = "sc_capabilities_dynamic" |
| sources = [ "test.cc" ] |
| deps = [ |
| ":config_lib", |
| ":test.config_cpp", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", |
| "//sdk/fidl/fuchsia.component.runtime:fuchsia.component.runtime_cpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/sys/component/cpp/testing:cpp", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("child_bin") { |
| testonly = true |
| output_name = "sc_capabilities_dynamic_child" |
| sources = [ "child.cc" ] |
| deps = [ |
| ":test.config_cpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/component/outgoing/cpp", |
| ] |
| } |
| |
| fuchsia_component("sc_capabilities_dynamic") { |
| testonly = true |
| manifest = "meta/test.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component_manifest("child_manifest") { |
| testonly = true |
| component_name = "child" |
| manifest = "meta/child.cml" |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("config_lib") { |
| testonly = true |
| namespace = "config" |
| cm_label = ":child_manifest" |
| } |
| |
| fuchsia_structured_config_values("values") { |
| testonly = true |
| cm_label = ":child_manifest" |
| component_name = "child" |
| values = { |
| my_flag = false |
| my_int = 0 |
| transitional = 5 |
| } |
| } |
| |
| fuchsia_component("child") { |
| testonly = true |
| cm_label = ":child_manifest" |
| deps = [ ":child_bin" ] |
| } |
| |
| fidl("test.config") { |
| testonly = true |
| sources = [ "config.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| fuchsia_test_package("tests") { |
| package_name = "sc_capabilites_dynamic" |
| test_components = [ ":sc_capabilities_dynamic" ] |
| deps = [ |
| ":child", |
| ":values", |
| ] |
| } |