| # 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/components.gni") |
| import("//src/lib/vulkan/vulkan.gni") |
| |
| fuchsia_component_manifest("config-manifest") { |
| manifest = "meta/config.shard.cml" |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("config") { |
| cm_label = ":config-manifest" |
| } |
| |
| source_set("common") { |
| sources = [ |
| "//src/graphics/tests/common/utils.cc", |
| "//src/graphics/tests/common/vulkan_context.cc", |
| "//src/graphics/tests/common/vulkan_context.h", |
| ] |
| |
| public_deps = [ |
| "//src/lib/vulkan", |
| "//third_party/googletest:gtest_no_testonly", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| # This target can set the gpu vendor ID from a config exactly matching the one in meta/config.shard.cml. |
| source_set("config_query") { |
| sources = [ "config_query.cc" ] |
| deps = [ |
| ":common", |
| ":config", |
| ] |
| } |
| |
| source_set("gtest_main") { |
| sources = [ "gtest_main.cc" ] |
| public_deps = [ |
| # This library is used by code in the SDK, so it can't be testonly. |
| "//third_party/googletest:gtest_no_testonly", |
| ] |
| } |
| } |
| |
| executable("vkcontext_bin") { |
| testonly = true |
| output_name = "vkcontext" |
| |
| sources = [ "test_vkcontext.cc" ] |
| |
| deps = [ |
| ":common", |
| "//src/lib/vulkan", |
| ] |
| |
| public_deps = [ |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_test_component("vkcontext_cmp") { |
| component_name = "vkcontext" |
| deps = [ |
| ":vkcontext_bin", |
| "//src/lib/vulkan/validation_layers", |
| ] |
| |
| manifest = "meta/vkcontext.cml" |
| test_type = "vulkan" |
| } |
| |
| fuchsia_test_package("vkcontext-pkg") { |
| package_name = "vkcontext" |
| test_components = [ ":vkcontext_cmp" ] |
| test_specs = { |
| environments = vulkan_envs |
| } |
| } |
| |
| group("vkcontext") { |
| testonly = true |
| deps = [ ":vkcontext-pkg" ] |
| } |