| # Copyright 2016 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.gni") |
| import("//build/packages/sdk_fuchsia_package.gni") |
| import("//build/test.gni") |
| import("//build/testing/environments.gni") |
| import("//src/graphics/lib/magma/gnbuild/magma.gni") |
| import("//src/lib/vulkan/vulkan.gni") |
| |
| # Used by other Vulkan tests. |
| source_set("helper") { |
| sources = [ |
| "vkreadback.cc", |
| "vkreadback.h", |
| ] |
| |
| deps = [ |
| "//src/graphics/tests/common", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| public_deps = [ |
| "//src/lib/vulkan", |
| "//third_party/googletest:gtest_no_testonly", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| # Built both on Fuchsia and on the host. |
| executable("vkreadback_test") { |
| sources = [ "vkreadback_test.cc" ] |
| |
| deps = [ |
| ":helper", |
| "../common:gtest_main", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [ "//src/graphics/tests/common:config_query" ] |
| } |
| |
| # TODO(https://fxbug.dev/42053185): Add macOS support to VulkanContext and remove this. |
| if (is_host) { |
| environments = [ linux_env ] |
| } |
| } |
| |
| fuchsia_component_manifest("vkreadback-manifest") { |
| component_name = "vkreadback_child" |
| manifest = "meta/vkreadback_child.cml" |
| } |
| |
| fuchsia_component("vkreadback_test_child_component") { |
| component_name = "vkreadback_child" |
| deps = [ |
| ":vkreadback_test", |
| "//src/lib/vulkan/validation_layers", |
| ] |
| cm_label = ":vkreadback-manifest" |
| } |
| |
| fuchsia_structured_config_values("default_config") { |
| cm_label = ":vkreadback-manifest" |
| values = { |
| gpu_vendor_id = 0 |
| disabled_test_pattern = "" |
| } |
| } |
| |
| fuchsia_package("vkreadback_test_child_package") { |
| package_name = "vkreadback-test" |
| deps = [ ":vkreadback_test_child_component" ] |
| deps += [ ":default_config" ] |
| validate_structured_config = false |
| } |
| |
| sdk_fuchsia_package("vkreadback_test_sdk") { |
| distribution_name = "vkreadback_test" |
| category = "partner" |
| package_label = ":vkreadback_test_child_package" |
| expected_files_exact = [ "meta/vkreadback_child.cm" ] |
| api_level_added = 19 |
| } |
| |
| fuchsia_test_component("vkreadback_test_component") { |
| component_name = "vkreadback_test" |
| manifest = "meta/vkreadback.cml" |
| test_type = "vulkan" |
| } |
| |
| fuchsia_test_package("vkreadback_test_package") { |
| package_name = "vkreadback_test" |
| test_components = [ ":vkreadback_test_component" ] |
| subpackages = [ ":vkreadback_test_child_package" ] |
| test_specs = { |
| # TODO(https://fxbug.dev/42124112): Restore astro_env when https://fxbug.dev/42120999 is fixed. |
| environments = vulkan_envs + [ astro_env ] - [ astro_env ] |
| } |
| } |
| |
| group("vkreadback") { |
| testonly = true |
| deps = [ ":vkreadback_test_package" ] |
| if (is_host && !is_mac) { |
| # TODO(https://fxbug.dev/42053185): Add macOS support to VulkanContext and run this everywhere |
| deps += [ ":vkreadback_test($host_toolchain)" ] |
| } |
| } |