blob: 801854f8eaf5a33af886bc3a76f31406686e805c [file] [log] [blame]
# 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/fidl/toolchain.gni")
import("//build/python/python_host_test.gni")
import("//sdk/cts/build/cts_copy_to_sdk.gni")
import("//sdk/cts/build/write_cts_file.gni")
# A test that fails if breaking changes were made to PlaSA signatures between CTS releases.
#
# For more information on the Fuchsia PlaSA, see:
# https://fuchsia.dev/fuchsia-src/development/testing/cts/plasa_overview
#
# Parameters
#
# old_cts_path
# The absolute path to the older CTS release.
#
# new_cts_path
# The absolute path to the newer CTS release.
#
# deps
template("cts_signature_tests") {
assert(defined(invoker.old_cts_path), "old_cts_path is required")
assert(defined(invoker.new_cts_path), "new_cts_path is required")
_before_manifest = "${invoker.old_cts_path}/manifest.cts.plasa.json"
_after_manifest = "${invoker.new_cts_path}/manifest.cts.plasa.json"
python_host_test(target_name) {
forward_variables_from(invoker, [ "deps" ])
main_source = "//sdk/cts/build/scripts/signature_tests.py"
sources = [ "//sdk/cts/build/scripts/plasa_differ.py" ]
extra_args = [
"--before_manifest",
rebase_path(_before_manifest, root_build_dir),
"--after_manifest",
rebase_path(_after_manifest, root_build_dir),
# For a list of all PlaSA element kinds, see docs/development/testing/cts/plasa_manifest.md.
"--kinds=api_fidl",
"--utils_dir",
rebase_path("$root_build_dir/host_x64", root_build_dir),
]
deps += [
":${target_name}_cts_deps",
"//tools/fidl/fidl_api_diff:host",
]
}
# TODO(fxbug.dev/97023): Explicitly list all sources in cts/fidling.
host_test_data("${target_name}_cts_deps") {
forward_variables_from(invoker, [ "deps" ])
sources = [
_after_manifest,
_before_manifest,
invoker.new_cts_path + "/fidling",
invoker.old_cts_path + "/fidling",
]
}
}