| # Copyright 2021 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("//sdk/ctf/build/internal/ctf.gni") |
| |
| # Generates test targets from a CTF archive. |
| # |
| # Users can build ABI, API, and host tool tests using the following target names: |
| # - ABI tests: {target_name}_abi |
| # - API tests: {target_name}_api |
| # - Host tool tests: {target_name}_host |
| # - All: target_name |
| # |
| # Parameters: |
| # |
| # path (required) |
| # The path to the extracted CTF archive contents as a target label. |
| # Example: "//prebuilt/cts/canary/$host_platform/cts" |
| # |
| # disabled_tests |
| # A list of FAR archive names containing tests to skip. |
| # The archive names can be found in //prebult/cts/<version>/<platform>/cts. |
| template("compatibility_test_suite") { |
| assert(defined(invoker.path), |
| "The path to the extracted CTF archive is required.") |
| |
| # ABI Tests |
| abi_test_target_name = "${target_name}_abi" |
| ctf_prebuilt_tests_from_manifest(abi_test_target_name) { |
| forward_variables_from(invoker, [ "disabled_tests" ]) |
| ctf_path = rebase_path(invoker.path) |
| } |
| |
| test_targets = [ ":$abi_test_target_name" ] |
| |
| # Host Tool Tests |
| host_tool_test_target_name = "${target_name}_host" |
| if (is_host) { |
| prebuilt_host_test_manifest(host_tool_test_target_name) { |
| forward_variables_from(invoker, [ "disabled_tests" ]) |
| archive_dir = rebase_path(invoker.path) |
| } |
| } |
| |
| test_targets += [ ":$host_tool_test_target_name($host_toolchain)" ] |
| |
| group(target_name) { |
| testonly = true |
| deps = test_targets |
| } |
| } |