blob: 5d985f84b3843edf2a9a9dd5de7876b1dca789cc [file] [log] [blame]
# 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("//build/config/build_api_module.gni")
import("//sdk/cts/build/cts.gni")
# TODO(fxb/82775): Remove this target once infra points to //sdk:cts.
group("cts_artifacts") {
testonly = true
# build_api_module invocation moved to //sdk/cts/build/cts_sdk.gni
# and is hooked into the build from the //sdk:cts target.
deps = [ "//sdk:cts" ]
}
action("update_test_manifest") {
# When trying to build CTS at ToT and a previous version of CTS, the build fails because both CTS
# versions generate packages with identical names. This target appends the CTS version to the
# previous CTS version's package names in the test manifest. The previous version's package names
# are updated in the build via //sdk/cts/build/script/transform_build_gn.py.
script = "//sdk/cts/build/scripts/update_test_manifest.py"
inputs = [ "data/test_manifest.json" ]
outputs = [ "$target_gen_dir/test_manifest.json" ]
args = [
"--manifest",
rebase_path("data/test_manifest.json"),
"--out",
rebase_path(outputs[0]),
]
if (cts_version != "") {
args += [
"--cts_version",
cts_version,
]
}
}
cts_copy_to_sdk("test_manifest") {
testonly = true
dest = ""
sources = get_target_outputs(":update_test_manifest")
non_sdk_deps = [ ":update_test_manifest" ]
}
sdk_molecule("test_manifest") {
testonly = true
deps = [ ":test_manifest_sdk" ]
}
group("cts_no_e2e") {
testonly = true
assert_no_deps = e2e_test_libs
deps = [ "tests:tests_no_e2e" ]
# Prevents us from adding example tests and build scripts to the archive.
path = get_label_info(":${target_name}", "dir")
is_cts_tot = string_replace(path, "//sdk/cts", "") != path
if (is_cts_tot) {
deps += [
"build/scripts:tests",
"examples:tests",
]
}
}
group("cts") {
testonly = true
deps = [
":cts_no_e2e",
"tests",
]
}
cts_copy_to_sdk("build") {
sources = [ "BUILD.gn" ]
testonly = true
}
sdk_molecule("cts_tests") {
category = "cts"
deps = [
":build_sdk",
":cts_deps",
":test_manifest",
"tests:test_sdks",
"//sdk/testing/fidl:test_sdks",
"//src/sys/component_manager/tests/reboot_on_terminate:test_sdks",
]
# Prevents us from adding example tests to the archive.
path = get_label_info(":${target_name}", "dir")
is_cts_tot = string_replace(path, "//sdk/cts", "") != path
if (is_cts_tot) {
deps += [ "examples:test_sdks" ]
}
testonly = true
}
sdk_molecule("cts_deps") {
category = "cts"
deps = [ "//zircon/public/sysroot/sdk:sysroot_sdk" ]
testonly = true
}