blob: 64283547100a21b4eb9746d2864b152b76241746 [file] [log] [blame]
# Copyright 2019 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("gn/build_rules.gni")
# Ensure that host tests are always rebuilt with device ones on Linux hosts.
_build_host_tests =
is_fuchsia && target_cpu == "x64" && host_os == "linux" # b/48603
group("compute") {
deps = [
"common",
"common/vk",
"hotsort",
"mold",
"spinel",
"spinel-rs",
"spinel-rs-sys",
"spinel/platforms/vk",
"surpass",
"svg",
]
}
# IMPORTANT: Most graphics compute tests cannot run on the CQ for now due to
# a missing appropriate bot configuration (see fxbug.dev/25516 for details). Thus tests
# are spread over two targets.
#
# tests: A group that lists all the tests to build by default, and which
# will be run during continuous integration, since this is reachable
# from //bundles/tests.
#
# all_tests: A group that depends on 'tests', but adds other programs
# and test packages that should not or cannot run during
# continuous integration.
#
# 'fx run-test <name>' or 'fx run-host-tests <name>' can be used to manually
# launch a test that was defined with graphics_compute_test_package() or
# graphics_compute_unittests_package().
#
# Other programs (e.g. graphics_compute_executable() targets) can be run with
# "fx shell run <name>" or "out/default/host_x64/<name>" instead.
#
group("tests") {
testonly = true
public_deps = [
":graphics-compute-unittests",
"mold:mold-tests",
"spinel-rs:spinel-rs-tests",
"spinel-rs-sys:tests",
"surpass:surpass-tests",
]
# NOTE: All dependencies here are run in continuous integration, but our
# host bots currently lack a proper Vulkan loader + ICD. Thus only add
# the device-specific Vulkan-based unit-tests for now.
if (is_fuchsia) {
public_deps += [ ":graphics-compute-vk-unittests" ]
}
if (_build_host_tests) {
data_deps = [
":tests($host_toolchain)",
"tests/common/svg:spn_svg_dump($host_toolchain)",
]
}
}
group("all_tests") {
testonly = true
public_deps = [
":graphics-compute-vk-unittests",
":tests",
"examples",
"hotsort:tests",
"tests:tests",
]
if (_build_host_tests) {
data_deps = [ ":all_tests($host_toolchain)" ]
}
}
# A target used to group all simple graphics compute unit-tests
# (i.e. those that do not depend on Vulkan for now). Unlike Vulkan-based
# tests, these can run anywhere on the CQ.
graphics_compute_unittests_package("graphics-compute-unittests") {
deps = [
"common:common_unittests",
"spinel:spinel_ext_unittests",
"svg:svg_unittests",
"tests:common_unittests",
"tests/common/spinel:unittests",
"tests/common/svg:unittests",
"tests/mock_spinel:mock_spinel_unittests",
]
}
# A target used to group all graphics compute unit-tests that depend
# on a working Vulkan environment and that link against the Spinel library.
graphics_compute_unittests_package("graphics-compute-vk-unittests") {
deps = [
"spinel:vk_unittests",
"tests:common_vk_unittests",
"tests/common/spinel_vk:unittests",
]
needs_vulkan = true
# TODO(fxbug.dev/58615): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}