| # 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/graphics/lib/magma/gnbuild/magma.gni") |
| import("test-data.gni") |
| |
| assert(magma_openvx_package != "", "magma_openvx_package must be defined") |
| assert(magma_openvx_include != "", "magma_openvx_include must be defined") |
| |
| import("${magma_openvx_package}/fuchsia/openvx-data.gni") |
| resource_deps = [] |
| i = 0 |
| foreach(src_dst_pair, openvx_data + test_data) { |
| resource_target = "resource_$i" |
| resource(resource_target) { |
| sources = [ rebase_path(src_dst_pair[0]) ] |
| outputs = [ "data/" + src_dst_pair[1] ] |
| } |
| resource_deps += [ ":$resource_target" ] |
| i += 1 |
| } |
| |
| config("openvx_cts_vsi_config") { |
| defines = [ |
| "VIVANTE_CHANGE_CODE=1", |
| ] |
| } |
| |
| config("openvx_cts_config") { |
| defines = [ |
| "HAVE_VERSION_INC", |
| "OPENVX_USE_NN", |
| ] |
| |
| cflags_c = [ |
| "-Wno-missing-field-initializers", |
| "-Wno-sign-compare", |
| "-Wno-sizeof-array-div", |
| "-Wno-unused-function", |
| "-Wno-unused-variable", |
| "-Wno-missing-braces", |
| "-Wno-incompatible-pointer-types", |
| "-Wno-conversion", |
| "-Wno-unused-but-set-variable", |
| "-Wno-strict-prototypes", |
| "-Wno-extra-semi", |
| ] |
| |
| ldflags = [ "-Wl,-z,stack-size=0x1000000" ] |
| |
| include_dirs = [ |
| rebase_path("$magma_openvx_include"), |
| "..", |
| ] |
| } |
| |
| executable("vx_test_conformance_vsi") { |
| output_name = "vx_test_conformance" |
| |
| configs += [ |
| ":openvx_cts_vsi_config", |
| ":openvx_cts_config", |
| ] |
| |
| src = "../test_conformance" |
| include_dirs = [ |
| "$src", |
| ] |
| |
| sources = [ |
| "$src/test_accumulate.c", |
| "$src/test_accumulatesquare.c", |
| "$src/test_accumulateweighted.c", |
| "$src/test_addsub.c", |
| "$src/test_array.c", |
| "$src/test_bilateralfilter.c", |
| "$src/test_binop16s.c", |
| "$src/test_binop8u.c", |
| "$src/test_box3x3.c", |
| "$src/test_canny.c", |
| "$src/test_channelcombine.c", |
| "$src/test_channelextract.c", |
| "$src/test_controlflow.c", |
| "$src/test_convertcolor.c", |
| "$src/test_convertdepth.c", |
| "$src/test_convolution.c", |
| "$src/test_convolve.c", |
| "$src/test_copy.c", |
| "$src/test_dilate3x3.c", |
| "$src/test_distribution.c", |
| "$src/test_eqhist.c", |
| "$src/test_erode3x3.c", |
| "$src/test_export_import_extension.c", |
| "$src/test_fast.c", |
| "$src/test_gaussian3x3.c", |
| "$src/test_gaussianpyramid.c", |
| "$src/test_graph.c", |
| "$src/test_graph_callbacks.c", |
| "$src/test_graph_delay.c", |
| "$src/test_graph_roi.c", |
| "$src/test_halfscalegaussian.c", |
| "$src/test_harriscorners.c", |
| "$src/test_histogram.c", |
| "$src/test_hog.c", |
| "$src/test_houghlinesp.c", |
| "$src/test_integral.c", |
| "$src/test_laplacianpyramid.c", |
| "$src/test_lbp.c", |
| "$src/test_logging.c", |
| "$src/test_lut.c", |
| "$src/test_magnitude.c", |
| "$src/test_main.c", |
| "$src/test_matchtemplate.c", |
| "$src/test_matrix.c", |
| "$src/test_max.c", |
| "$src/test_meanstddev.c", |
| "$src/test_median3x3.c", |
| "$src/test_min.c", |
| "$src/test_minmaxloc.c", |
| "$src/test_multiply.c", |
| "$src/test_nonlinearfilter.c", |
| "$src/test_nonmaxsuppression.c", |
| "$src/test_not.c", |
| "$src/test_object_array.c", |
| "$src/test_optflowpyrlk.c", |
| "$src/test_phase.c", |
| "$src/test_remap.c", |
| "$src/test_scalar.c", |
| "$src/test_scale.c", |
| "$src/test_smoke.c", |
| "$src/test_sobel3x3.c", |
| "$src/test_target.c", |
| "$src/test_tensor_networks.c", |
| "$src/test_tensor_nn.c", |
| "$src/test_tensor_op.c", |
| "$src/test_threshold.c", |
| "$src/test_usernode.c", |
| "$src/test_vximage.c", |
| "$src/test_warpaffine.c", |
| "$src/test_warpperspective.c", |
| ] |
| |
| deps = [ |
| "${magma_openvx_package}", |
| ":test_engine", |
| ] |
| } |
| |
| loadable_module("libtest-testmodule") { |
| configs += [ ":openvx_cts_config" ] |
| configs -= [ "//build/config:symbol_visibility_hidden" ] |
| |
| src = "../test_conformance/test_module" |
| sources = [ |
| "$src/vx_testmodule_lib.c", |
| "$src/vx_testmodule_module.c" |
| ] |
| |
| deps = [ "${magma_openvx_package}" ] |
| } |
| |
| static_library("test_engine") { |
| configs += [ |
| ":openvx_cts_config", |
| ] |
| |
| src = "../test_engine" |
| include_dirs = [ |
| "$src", |
| ] |
| |
| sources = [ |
| "$src/test_bmp.c", |
| "$src/test_engine.c", |
| "$src/test_image.c", |
| "$src/test_mem.c", |
| "$src/test_utils.c", |
| ] |
| |
| deps = [ |
| "${magma_openvx_package}", |
| ] |
| } |
| # fuchsia-pkg://fuchsia.com/openvx_cts#meta/openvx_cts.cml |
| fuchsia_test_component("openvx_cts_vsi_cmp") { |
| component_name = "openvx_cts" |
| deps = [ |
| ":vx_test_conformance_vsi", |
| ":libtest-testmodule", |
| ] + resource_deps |
| manifest = "meta/test_openvx_cts.cml" |
| test_type = "system" |
| } |
| |
| fuchsia_test_package("openvx-cts-vsi") { |
| package_name = "openvx_cts" |
| test_components = [ ":openvx_cts_vsi_cmp" ] |
| } |