| # 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("//cts/build/cts_element.gni") |
| import("//cts/build/cts_vars.gni") |
| import("//src/sys/build/components.gni") |
| |
| # A Fuchsia component that can be used in CTS. |
| # |
| # An equivalent to fuchsia_component, but ensures dependencies are allowed in CTS. |
| # |
| # Example: |
| # ``` |
| # cts_component("my-test-component") { |
| # deps = [ ":my-test" ] |
| # manifest = "meta/my-test.cmx" |
| # testonly = true |
| # } |
| # ``` |
| template("cts_component") { |
| if (defined(invoker.deps)) { |
| cts_element("unused") { |
| deps = invoker.deps |
| } |
| } |
| |
| fuchsia_component(target_name) { |
| forward_variables_from(invoker, "*") |
| } |
| |
| # Creates a file to enable other CTS targets to depend on this test package. |
| write_file("${root_gen_dir}/cts/${target_name}.${cts_extension}", "true") |
| } |