1# Copyright (c) 2021 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 16if (defined(ohos_lite)) { 17 import("//build/lite/config/test.gni") 18 import("//drivers/hdf_core/adapter/uhdf/uhdf.gni") 19 20 config("cameraTest_config") { 21 visibility = [ ":*" ] 22 } 23 24 unittest("camera_case_liteos") { 25 output_extension = "bin" 26 output_dir = "$root_out_dir/test/unittest/hdf" 27 sources = [ 28 "$camera_path/../interfaces/hdi_passthrough/callback/src/camera_device_callback.cpp", 29 "$camera_path/../interfaces/hdi_passthrough/callback/src/camera_host_callback.cpp", 30 "$camera_path/../interfaces/hdi_passthrough/callback/src/stream_operator_callback.cpp", 31 "./src/adapter_test.cpp", 32 "./src/buffer_manager_test.cpp", 33 "./src/camera_3a_test.cpp", 34 "./src/capture_test.cpp", 35 "./src/common.cpp", 36 "./src/device_manager_test.cpp", 37 "./src/dfx_test.cpp", 38 "./src/flashlight_test.cpp", 39 "./src/hdi_callback_test.cpp", 40 "./src/hdi_device_test.cpp", 41 "./src/hdi_host_test.cpp", 42 "./src/hdi_stream_test.cpp", 43 "./src/offline_stream_test.cpp", 44 "./src/open_camera_test.cpp", 45 "./src/performance_func_test.cpp", 46 "./src/performance_hdi_test.cpp", 47 "./src/pipeline_test.cpp", 48 "./src/preview_test.cpp", 49 "./src/resolution_test.cpp", 50 "./src/stability_test.cpp", 51 "./src/video_test.cpp", 52 ] 53 54 include_dirs = [ 55 "//third_party/googletest/googletest/include/gtest", 56 "./include", 57 "$camera_path/../interfaces/include", 58 "$camera_path/../interfaces/hdi_passthrough", 59 "$camera_path/../interfaces/hdi_passthrough/callback/include", 60 "$camera_path/include", 61 "$camera_path/metadata_lite", 62 "$camera_path/hdi_impl", 63 "$camera_path/hdi_impl/include", 64 "$camera_path/hdi_impl/include/camera_host", 65 "$camera_path/hdi_impl/include/camera_device", 66 "$camera_path/hdi_impl/include/stream_operator", 67 "$camera_path/hdi_impl/include/offline_stream_operator", 68 "$camera_path/device_manager/include/", 69 "$camera_path/device_manager/include/mpi", 70 "//base/hiviewdfx/interfaces/innerkits/libhilog/include", 71 "$camera_path/utils/event", 72 "//drivers/peripheral/base", 73 "//drivers/peripheral/camera/interfaces/metadata/include", 74 "//drivers/peripheral/display/interfaces/include", 75 "//foundation/graphic/surface/interfaces/kits", 76 "//foundation/graphic/surface/interfaces/innerkits", 77 "//base/startup/init/interfaces/innerkits/include/syspara", 78 79 #producer 80 "$camera_path/pipeline_core/utils", 81 "$camera_path/pipeline_core/include", 82 "$camera_path/pipeline_core/host_stream/include", 83 "$camera_path/pipeline_core/nodes/include", 84 "$camera_path/pipeline_core/nodes/src/node_base", 85 "$camera_path/pipeline_core/nodes/src/dummy_node", 86 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", 87 "$camera_path/pipeline_core/pipeline_impl/include", 88 "$camera_path/pipeline_core/pipeline_impl/src", 89 "$camera_path/pipeline_core/pipeline_impl/src/builder", 90 "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", 91 "$camera_path/pipeline_core/pipeline_impl/src/parser", 92 "$camera_path/pipeline_core/pipeline_impl/src/strategy", 93 "$camera_path/pipeline_core/ipp/include", 94 95 "//drivers/hdf_core/framework/include/osal", 96 "//drivers/hdf_core/framework/include/utils", 97 "//drivers/hdf_core/adapter/uhdf2/osal/include", 98 "//system/core/include/cutils", 99 "$hdf_uhdf_path/manager/include", 100 "$hdf_uhdf_path/include/hdi", 101 ] 102 103 deps = [ 104 "$camera_path/buffer_manager:camera_buffer_manager", 105 "$camera_path/device_manager:camera_device_manager", 106 "$camera_path/hdi_impl:camera_host_service_1.0", 107 "$camera_path/pipeline_core:camera_pipeline_core", 108 "$hdf_uhdf_path/utils:libhdf_utils", 109 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 110 "//base/startup/init/interfaces/innerkits:libbegetutil", 111 "//drivers/peripheral/camera/interfaces/metadata:metadata", 112 ] 113 } 114} else { 115 import("//build/ohos.gni") 116 import("//build/test.gni") 117 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 118 119 module_output_path = "hdf/camera" 120 121 config("cameraTest_config") { 122 visibility = [ ":*" ] 123 } 124 125 ohos_unittest("camera_case_unittest") { 126 testonly = true 127 module_out_path = module_output_path 128 sources = [ 129 "./src/adapter_test.cpp", 130 "./src/buffer_manager_test.cpp", 131 "./src/camera_3a_test.cpp", 132 "./src/capture_test.cpp", 133 "./src/common.cpp", 134 "./src/device_manager_test.cpp", 135 "./src/dfx_test.cpp", 136 "./src/flashlight_test.cpp", 137 "./src/hdi_callback_test.cpp", 138 "./src/hdi_device_test.cpp", 139 "./src/hdi_host_test.cpp", 140 "./src/hdi_stream_test.cpp", 141 "./src/offline_stream_test.cpp", 142 "./src/open_camera_test.cpp", 143 "./src/performance_func_test.cpp", 144 "./src/performance_hdi_test.cpp", 145 "./src/pipeline_test.cpp", 146 "./src/preview_test.cpp", 147 "./src/resolution_test.cpp", 148 "./src/stability_test.cpp", 149 "./src/video_test.cpp", 150 ] 151 152 include_dirs = [ 153 "//third_party/googletest/googletest/include/gtest", 154 "./include", 155 "$camera_path/../interfaces/include", 156 "$camera_path/../interfaces/hdi_ipc", 157 "$camera_path/../interfaces/hdi_ipc/server/include", 158 "$camera_path/../interfaces/hdi_ipc/utils/include", 159 "$camera_path/../interfaces/hdi_ipc/client/include", 160 "$camera_path/../interfaces/hdi_ipc/callback/host/include", 161 "$camera_path/../interfaces/hdi_ipc/callback/device/include", 162 "$camera_path/../interfaces/hdi_ipc/callback/operator/include", 163 "$camera_path/include", 164 "$camera_path/hdi_impl", 165 "$camera_path/hdi_impl/include", 166 "$camera_path/hdi_impl/include/camera_host", 167 "$camera_path/hdi_impl/include/camera_device", 168 "$camera_path/hdi_impl/include/stream_operator", 169 "$camera_path/hdi_impl/include/offline_stream_operator", 170 "$camera_path/device_manager/include/", 171 "$camera_path/device_manager/include/mpi", 172 "$camera_path/utils/event", 173 "//drivers/peripheral/camera/interfaces/metadata/include", 174 175 #producer 176 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", 177 "$camera_path/pipeline_core/utils", 178 "$camera_path/pipeline_core/include", 179 "$camera_path/pipeline_core/host_stream/include", 180 "$camera_path/pipeline_core/nodes/include", 181 "$camera_path/pipeline_core/nodes/src/node_base", 182 "$camera_path/pipeline_core/nodes/src/dummy_node", 183 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", 184 "$camera_path/pipeline_core/pipeline_impl/include", 185 "$camera_path/pipeline_core/pipeline_impl/src", 186 "$camera_path/pipeline_core/pipeline_impl/src/builder", 187 "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", 188 "$camera_path/pipeline_core/pipeline_impl/src/parser", 189 "$camera_path/pipeline_core/pipeline_impl/src/strategy", 190 "$camera_path/pipeline_core/ipp/include", 191 192 # hcs parser 193 "//system/core/include/cutils", 194 ] 195 196 deps = [ 197 "$camera_path/buffer_manager:camera_buffer_manager", 198 "$camera_path/device_manager:camera_device_manager", 199 "$camera_path/hdi_impl:camera_host_service_1.0", 200 "$camera_path/pipeline_core:camera_pipeline_core", 201 "//drivers/interface/camera/v1_0:libcamera_proxy_1.0", 202 "//drivers/peripheral/camera/interfaces/metadata:metadata", 203 "//third_party/googletest:gmock", 204 "//third_party/googletest:gmock_main", 205 "//third_party/googletest:gtest", 206 "//third_party/googletest:gtest_main", 207 ] 208 209 if (is_standard_system) { 210 external_deps = [ 211 "c_utils:utils", 212 "hdf_core:libhdf_utils", 213 "hdf_core:libhdi", 214 "hiviewdfx_hilog_native:libhilog", 215 "ipc:ipc_single", 216 ] 217 } else { 218 external_deps = [ "hilog:libhilog" ] 219 } 220 221 external_deps += [ 222 "init:libbegetutil", 223 "ipc:ipc_single", 224 "samgr:samgr_proxy", 225 ] 226 227 public_configs = [ ":cameraTest_config" ] 228 } 229} 230