1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//drivers/peripheral/camera/hal/camera.gni") 15 16at_root_path = "$camera_path/test/at" 17 18if (defined(ohos_lite)) { 19 import("//build/lite/config/test.gni") 20 import("//drivers/hdf_core/adapter/uhdf/uhdf.gni") 21 22 config("camhdi_at_test_config") { 23 visibility = [ ":*" ] 24 cflags_cc = [ 25 "-DGST_DISABLE_DEPRECATED", 26 "-DHAVE_CONFIG_H", 27 "-DCOLORSPACE=\"videoconvert\"", 28 ] 29 cflags_cc += [ "-std=c++17" ] 30 } 31 32 unittest("camera_test_at") { 33 output_extension = "bin" 34 output_dir = "$root_out_dir/test/unittest/hdf" 35 sources = [ 36 "$at_root_path/hdi/utest_camera_device_impl.cpp", 37 "$at_root_path/hdi/utest_camera_hdi_base.cpp", 38 "$at_root_path/hdi/utest_camera_host_impl.cpp", 39 "$at_root_path/hdi/utest_stream_operator_impl.cpp", 40 "$camera_path/../interfaces/hdi_passthrough/callback/src/camera_device_callback.cpp", 41 "$camera_path/../interfaces/hdi_passthrough/callback/src/camera_host_callback.cpp", 42 "$camera_path/../interfaces/hdi_passthrough/callback/src/stream_operator_callback.cpp", 43 ] 44 45 include_dirs = [ 46 "$camera_path/../interfaces/include", 47 "$camera_path/../interfaces/hdi_passthrough", 48 "$camera_path/../interfaces/hdi_passthrough/callback/include", 49 "$camera_path/include", 50 "$camera_path/hdi_impl", 51 "$camera_path/hdi_impl/test", 52 "$camera_path/hdi_impl/include", 53 "$camera_path/hdi_impl/include/camera_host", 54 "$camera_path/hdi_impl/include/camera_device", 55 "$camera_path/hdi_impl/include/stream_operator", 56 "$camera_path/hdi_impl/include/offline_stream_operator", 57 "$camera_path/hdi_impl/src/stream_operator/stream_tunnel/lite", 58 "$camera_path/device_manager/include/", 59 "$camera_path/device_manager/include/mpi", 60 "//base/hiviewdfx/interfaces/innerkits/libhilog/include", 61 "$camera_path/utils/event", 62 "//drivers/peripheral/base", 63 "//drivers/peripheral/camera/interfaces/metadata/include", 64 "//drivers/peripheral/display/interfaces/include", 65 "//foundation/graphic/surface/interfaces/kits", 66 "//foundation/graphic/surface/interfaces/innerkits", 67 68 #producer 69 "$camera_path/pipeline_core/utils", 70 "$camera_path/pipeline_core/include", 71 "$camera_path/pipeline_core/host_stream/include", 72 "$camera_path/pipeline_core/nodes/include", 73 "$camera_path/pipeline_core/nodes/src/node_base", 74 "$camera_path/pipeline_core/nodes/src/dummy_node", 75 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", 76 "$camera_path/pipeline_core/pipeline_impl/include", 77 "$camera_path/pipeline_core/pipeline_impl/src", 78 "$camera_path/pipeline_core/pipeline_impl/src/builder", 79 "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", 80 "$camera_path/pipeline_core/pipeline_impl/src/parser", 81 "$camera_path/pipeline_core/pipeline_impl/src/strategy", 82 "$camera_path/pipeline_core/ipp/include", 83 84 # HCS 85 "//drivers/hdf_core/framework/include/config", 86 "//drivers/hdf_core/framework/include/osal", 87 "//drivers/hdf_core/framework/include/utils", 88 "//drivers/hdf_core/adapter/uhdf2/include/config", 89 "//drivers/hdf_core/framework/ability/config/hcs_parser/include", 90 "//system/core/include/cutils", 91 "//drivers/hdf_core/adapter/uhdf2/osal/include", 92 "$hdf_framework_path/ability/sbuf/include", 93 "$hdf_uhdf_path/manager/include", 94 "$hdf_uhdf_path/include/hdi", 95 96 "$hdf_uhdf_path/devhost/include", 97 "$hdf_uhdf_path/devmgr/include", 98 "$hdf_uhdf_path/host/include", 99 ] 100 101 deps = [ 102 "$camera_path/buffer_manager:camera_buffer_manager", 103 "$camera_path/device_manager:camera_device_manager", 104 "$camera_path/hdi_impl:camera_host_service_1.0", 105 "$camera_path/pipeline_core:camera_pipeline_core", 106 "$hdf_uhdf_path/utils:libhdf_utils", 107 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 108 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 109 "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform", 110 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 111 "//drivers/hdf_core/adapter/uhdf/test/unittest/common:hdf_test_common", 112 "//drivers/peripheral/camera/interfaces/metadata:metadata", 113 ] 114 } 115} else { 116 import("//build/ohos.gni") 117 import("//build/test.gni") 118 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 119 120 module_output_path = "drivers_peripheral_camera/camera" 121 122 config("camhdi_at_test_config") { 123 visibility = [ ":*" ] 124 cflags_cc = [ 125 "-DGST_DISABLE_DEPRECATED", 126 "-DHAVE_CONFIG_H", 127 "-DCOLORSPACE=\"videoconvert\"", 128 ] 129 } 130 131 ohos_unittest("camera_test_at") { 132 testonly = true 133 module_out_path = module_output_path 134 sources = [ 135 "$at_root_path/hdi/utest_camera_device_impl.cpp", 136 "$at_root_path/hdi/utest_camera_hdi_base.cpp", 137 "$at_root_path/hdi/utest_camera_host_impl.cpp", 138 "$at_root_path/hdi/utest_stream_operator_impl.cpp", 139 ] 140 141 include_dirs = [ 142 "//third_party/googletest/googletest/include/gtest", 143 "$camera_path/../interfaces/include", 144 "$camera_path/../interfaces/hdi_ipc", 145 "$camera_path/../interfaces/hdi_ipc/utils/include", 146 "$camera_path/../interfaces/hdi_ipc/callback/host/include", 147 "$camera_path/../interfaces/hdi_ipc/callback/device/include", 148 "$camera_path/../interfaces/hdi_ipc/callback/operator/include", 149 "$camera_path/include", 150 "$camera_path/hdi_impl", 151 "$camera_path/hdi_impl/include", 152 "$camera_path/hdi_impl/include/camera_host", 153 "$camera_path/hdi_impl/include/camera_device", 154 "$camera_path/hdi_impl/include/stream_operator", 155 "$camera_path/hdi_impl/include/offline_stream_operator", 156 "$camera_path/device_manager/include/", 157 "$camera_path/device_manager/include/mpi", 158 "$camera_path/utils/event", 159 "//drivers/peripheral/camera/interfaces/metadata/include", 160 161 #producer 162 "$camera_path/pipeline_core/utils", 163 "$camera_path/pipeline_core/include", 164 "$camera_path/pipeline_core/host_stream/include", 165 "$camera_path/pipeline_core/nodes/include", 166 "$camera_path/pipeline_core/nodes/src/node_base", 167 "$camera_path/pipeline_core/nodes/src/dummy_node", 168 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", 169 "$camera_path/pipeline_core/pipeline_impl/include", 170 "$camera_path/pipeline_core/pipeline_impl/src", 171 "$camera_path/pipeline_core/pipeline_impl/src/builder", 172 "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", 173 "$camera_path/pipeline_core/pipeline_impl/src/parser", 174 "$camera_path/pipeline_core/pipeline_impl/src/strategy", 175 "$camera_path/pipeline_core/ipp/include", 176 177 # HCS 178 "//system/core/include/cutils", 179 ] 180 181 deps = [ 182 "$camera_path/buffer_manager:camera_buffer_manager", 183 "$camera_path/device_manager:camera_device_manager", 184 "$camera_path/hdi_impl:camera_host_service_1.0", 185 "$camera_path/pipeline_core:camera_pipeline_core", 186 "//drivers/interface/camera/v1_0:libcamera_proxy_1.0", 187 "//drivers/peripheral/camera/interfaces/metadata:metadata", 188 "//third_party/googletest:gmock_main", 189 "//third_party/googletest:gtest", 190 "//third_party/googletest:gtest_main", 191 ] 192 193 if (is_standard_system) { 194 external_deps = [ 195 "c_utils:utils", 196 "hdf_core:libhdf_host", 197 "hdf_core:libhdf_ipc_adapter", 198 "hdf_core:libhdf_utils", 199 "hdf_core:libhdi", 200 "hiviewdfx_hilog_native:libhilog", 201 "ipc:ipc_single", 202 ] 203 } else { 204 external_deps = [ "hilog:libhilog" ] 205 } 206 207 external_deps += [ "samgr:samgr_proxy" ] 208 public_configs = [ ":camhdi_at_test_config" ] 209 } 210} 211