| # 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/fuchsia_test_component.gni") |
| |
| # Creates a component for a library fuzzer. |
| # |
| # The component created by this template correspond to the binary created by an invocation of |
| # `fuchsia_library_fuzzer`. |
| # |
| # Parameters: |
| # Same as `fuchsia_test_component`, except for `manifest`: |
| # manifest (required) |
| # [path] The component manifest. Only CML manifests are supported. |
| # |
| template("fuchsia_fuzzer_component") { |
| if (current_toolchain == default_toolchain) { |
| assert( |
| defined(invoker.manifest), |
| "A `manifest` argument was missing when calling fuchsia_fuzzer_component($target_name)") |
| fuchsia_test_component(target_name) { |
| manifest = invoker.manifest |
| forward_variables_from(invoker, |
| "*", |
| [ |
| "manifest", |
| "visibility", |
| ]) |
| forward_variables_from(invoker, [ "visibility" ]) |
| } |
| } else { |
| group(target_name) { |
| testonly = true |
| forward_variables_from(invoker, [ "visibility" ]) |
| deps = [ ":$target_name($default_toolchain)" ] |
| } |
| not_needed(invoker, "*") |
| } |
| } |