1# Copyright (c) 2023 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("../../../camera.gni") 15camera_test_path = "//drivers/peripheral/camera/test/hdi/" 16 17if (defined(ohos_lite)) { 18 import("//build/lite/config/test.gni") 19 import("../../../../../hdf_core/adapter/uhdf/uhdf.gni") 20 21 config("camhdi_at_test_config") { 22 visibility = [ ":*" ] 23 cflags_cc = [ 24 "-DGST_DISABLE_DEPRECATED", 25 "-DHAVE_CONFIG_H", 26 "-DCOLORSPACE=\"videoconvert\"", 27 ] 28 cflags_cc += [ "-std=c++17" ] 29 } 30 31 unittest("camera_test_at") { 32 output_extension = "bin" 33 output_dir = "$root_out_dir/test/unittest/hdf" 34 sources = [ 35 "$camera_path/../../test/common/callback/src/camera_device_callback.cpp", 36 "$camera_path/../../test/common/callback/src/camera_host_callback.cpp", 37 "$camera_path/../../test/common/callback/src/stream_operator_callback.cpp", 38 ] 39 40 include_dirs = [ 41 "$camera_path/../../interfaces/include", 42 "$camera_path/../../interfaces/hdi_passthrough", 43 "$camera_path/../../test/common/callback/include", 44 "$camera_path/include", 45 "$camera_path/../../hdi_service/v1_0/include", 46 "$camera_path/../v4l2/src/stream_operator/stream_tunnel/lite", 47 "$camera_path/device_manager/include/", 48 "$camera_path/device_manager/include/mpi", 49 "$camera_path/utils/event", 50 "$camera_path/../../base", 51 "$camera_path/../../display/interfaces/include", 52 53 #producer 54 "$camera_path/pipeline_core/utils", 55 "$camera_path/pipeline_core/include", 56 "$camera_path/pipeline_core/host_stream/include", 57 "$camera_path/pipeline_core/nodes/include", 58 "$camera_path/pipeline_core/nodes/src/node_base", 59 "$camera_path/pipeline_core/nodes/src/dummy_node", 60 "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", 61 "$camera_path/pipeline_core/pipeline_impl/include", 62 "$camera_path/pipeline_core/pipeline_impl/src", 63 "$camera_path/pipeline_core/pipeline_impl/src/builder", 64 "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", 65 "$camera_path/pipeline_core/pipeline_impl/src/parser", 66 "$camera_path/pipeline_core/pipeline_impl/src/strategy", 67 "$camera_path/pipeline_core/ipp/include", 68 ] 69 70 public_deps = [ 71 "$camera_path/../../hdi_service/v1_0:camera_host_service_1.0", 72 "$hdf_uhdf_path/utils:libhdf_utils", 73 "../../../../hdf_core/adapter/uhdf/manager:hdf_core", 74 ] 75 external_deps = [ 76 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 77 "drivers_interface_camera:metadata", 78 "drivers_interface_display:libdisplay_composer_proxy_1.0", 79 "graphic_chipsetsdk:surface", 80 "hdf_core:hdf_platform", 81 "hdf_core:hdf_posix_osal", 82 "hilog_featured_lite:hilog_shared", 83 ] 84 } 85} else { 86 import("//build/ohos.gni") 87 import("//build/test.gni") 88 import("../../../../../hdf_core/adapter/uhdf2/uhdf.gni") 89 90 module_output_path = "drivers_peripheral_camera/camera" 91 92 config("camhdi_at_test_config") { 93 visibility = [ ":*" ] 94 cflags_cc = [ 95 "-DGST_DISABLE_DEPRECATED", 96 "-DHAVE_CONFIG_H", 97 "-DCOLORSPACE=\"videoconvert\"", 98 ] 99 } 100 101 ohos_unittest("camera_test_at") { 102 testonly = true 103 module_out_path = module_output_path 104 sources = [ 105 "$camera_test_path/v1_0/src/camera_3a_uttest.cpp", 106 "$camera_test_path/v1_0/src/device_ability_uttest.cpp", 107 "$camera_test_path/v1_0/src/hdi_device_uttest.cpp", 108 "$camera_test_path/v1_0/src/hdi_host_uttest.cpp", 109 "$camera_test_path/v1_0/src/hdi_stream_uttest.cpp", 110 "$camera_test_path/v1_0/src/ut_common.cpp", 111 ] 112 113 include_dirs = [ 114 # common includes 115 "$camera_test_path/v1_0/include", 116 "//third_party/googletest/googletest/include", 117 "$camera_path/../../../display/interfaces/include", 118 "$camera_path/../../../display/hdi_service/gralloc/include", 119 "$camera_path/../../interfaces/include", 120 "$camera_path/include", 121 ] 122 123 deps = [ 124 "//third_party/googletest:gmock_main", 125 "//third_party/googletest:gtest", 126 "//third_party/googletest:gtest_main", 127 ] 128 129 if (is_standard_system) { 130 external_deps = [ 131 "c_utils:utils", 132 "hdf_core:libhdf_host", 133 "hdf_core:libhdf_ipc_adapter", 134 "hdf_core:libhdf_utils", 135 "hdf_core:libhdi", 136 "hilog:libhilog", 137 "ipc:ipc_single", 138 ] 139 } else { 140 external_deps = [ "hilog:libhilog" ] 141 } 142 143 external_deps += [ 144 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 145 "drivers_interface_camera:libcamera_proxy_1.0", 146 "drivers_interface_camera:metadata", 147 "drivers_interface_display:libdisplay_composer_proxy_1.0", 148 "graphic_chipsetsdk:surface", 149 "samgr:samgr_proxy", 150 ] 151 public_configs = [ ":camhdi_at_test_config" ] 152 } 153} 154