|  | # 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. | 
|  |  | 
|  | import("//src/sys/build/fuchsia_component.gni") | 
|  |  | 
|  | template("isolated_devmgr_unittest_v2_component") { | 
|  | if (!defined(invoker.manifest)) { | 
|  | generated_target = "${target_name}_generated_manifest" | 
|  | manifest = "$target_out_dir/${generated_target}.cml" | 
|  | generated_file(generated_target) { | 
|  | contents = { | 
|  | include = [ | 
|  | "sdk/lib/diagnostics/inspect/client.shard.cml", | 
|  | "sdk/lib/diagnostics/syslog/client.shard.cml", | 
|  | ] | 
|  | program = { | 
|  | if (defined(invoker.runner)) { | 
|  | runner = invoker.runner | 
|  | } else { | 
|  | runner = "gtest_runner" | 
|  | } | 
|  | binary = invoker.executable_path | 
|  | } | 
|  | children = [ | 
|  | { | 
|  | name = "isolated-devmgr" | 
|  | url = "fuchsia-pkg://fuchsia.com/isolated-devmgr#meta/isolated-devmgr.cm" | 
|  | startup = "eager" | 
|  | }, | 
|  | ] | 
|  | capabilities = [ | 
|  | { | 
|  | protocol = "fuchsia.test.Suite" | 
|  | }, | 
|  | ] | 
|  | use = [ | 
|  | { | 
|  | protocol = "fuchsia.process.Launcher" | 
|  | }, | 
|  | { | 
|  | protocol = "fuchsia.sys2.Realm" | 
|  | from = "framework" | 
|  | }, | 
|  | ] | 
|  | offer = [ | 
|  | { | 
|  | protocol = [ | 
|  | "fuchsia.logger.LogSink", | 
|  | "fuchsia.process.Launcher", | 
|  | "fuchsia.sys.Launcher", | 
|  | ] | 
|  | from = "parent" | 
|  | to = [ "#isolated-devmgr" ] | 
|  | }, | 
|  | ] | 
|  | expose = [ | 
|  | { | 
|  | protocol = "fuchsia.test.Suite" | 
|  | from = "self" | 
|  | }, | 
|  | ] | 
|  | } | 
|  | outputs = [ "$manifest" ] | 
|  | output_conversion = "json" | 
|  | testonly = true | 
|  | visibility = [ ":*" ] | 
|  | } | 
|  | } | 
|  | fuchsia_component(target_name) { | 
|  | testonly = true | 
|  | forward_variables_from(invoker, | 
|  | [ | 
|  | "deps", | 
|  | "manifest", | 
|  | "visibility", | 
|  | "component_name", | 
|  | ]) | 
|  | if (defined(generated_target)) { | 
|  | deps += [ ":$generated_target" ] | 
|  | } | 
|  | } | 
|  | } |