blob: be83ba3e61ad86baede7cffb72eb0c79ecbbdac9 [file] [log] [blame]
# Copyright 2017 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("//src/graphics/lib/magma/gnbuild/magma.gni")
if (magma_openvx_package != "") {
import("$magma_openvx_package/fuchsia/openvx-data.gni")
}
executable("test_membw_bin") {
output_name = "test_membw"
sources = [ "test_membw.cc" ]
}
fuchsia_unittest_package("test-membw") {
manifest = "meta/test_membw.cml"
deps = [ ":test_membw_bin" ]
}
executable("vkcopy_bin") {
output_name = "vkcopy"
sources = [ "vkcopy.cc" ]
deps = [
"//src/graphics/tests/common",
"//src/graphics/tests/common:config_query",
"//src/lib/vulkan",
]
public_deps = [
"//src/lib/fxl/test:test_settings",
"//third_party/googletest:gtest_no_testonly",
]
}
if (magma_openvx_package != "") {
executable("vxcopy_bin") {
output_name = "vxcopy"
testonly = true
sources = [ "vxcopy.cc" ]
assert(magma_openvx_include != "")
include_dirs = [ "$magma_openvx_include" ]
deps = [
"$magma_openvx_package",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
ldflags = [ "-Wl,-z,stack-size=0x1000000" ]
}
vxcopy_resource_deps = []
i = 0
foreach(src_dst_pair, openvx_data) {
resource_target = "vxcopy_resource_$i"
resource(resource_target) {
sources = [ rebase_path(src_dst_pair[0]) ]
outputs = [ src_dst_pair[1] ]
}
vxcopy_resource_deps += [ ":$resource_target" ]
i += 1
}
fuchsia_component("vxcopy_cmp") {
testonly = true
component_name = "vxcopy"
deps = [ ":vxcopy_bin" ] + vxcopy_resource_deps
manifest = "meta/vxcopy.cml"
}
fuchsia_test_package("vxcopy-pkg") {
package_name = "vxcopy"
test_components = [ ":vxcopy_cmp" ]
}
}
fuchsia_component_manifest("vkcopy_child_manifest") {
component_name = "vkcopy-test-child"
manifest = "meta/vkcopy_child.cml"
}
fuchsia_component("vkcopy_test_child_component") {
component_name = "vkcopy-test-child"
deps = [ ":vkcopy_bin" ]
cm_label = ":vkcopy_child_manifest"
}
fuchsia_structured_config_values("default_config") {
cm_label = ":vkcopy_child_manifest"
values = {
gpu_vendor_id = 0
disabled_test_pattern = ""
}
}
fuchsia_package("vkcopy_test_child_package") {
package_name = "vkcopy-test"
deps = [
":default_config",
":vkcopy_test_child_component",
]
}
sdk_fuchsia_package("vkcopy-test-sdk") {
distribution_name = "vkcopy-test"
category = "partner"
package_label = ":vkcopy_test_child_package"
api_level_added = 19
expected_files_exact = [ "meta/vkcopy-test-child.cm" ]
}
fuchsia_test_component("vkcopy_cmp") {
component_name = "vkcopy"
manifest = "meta/vkcopy.cml"
test_type = "vulkan"
}
fuchsia_test_package("vkcopy-pkg") {
package_name = "vkcopy"
test_components = [ ":vkcopy_cmp" ]
subpackages = [ ":vkcopy_test_child_package" ]
test_specs = {
environments = magma_libvulkan_hardware_envs
}
}
group("vulkan-benchmark") {
testonly = true
deps = [
":test-membw",
":vkcopy-pkg",
]
}
group("benchmark") {
testonly = true
deps = [ ":vulkan-benchmark" ]
if (magma_openvx_package != "") {
deps += [ ":vxcopy-pkg" ]
}
}
group("linux_x64") {
testonly = true
deps = [
":test_membw_bin(//build/toolchain:linux_x64)",
":vkcopy_bin(//build/toolchain:linux_x64)",
]
}