1# Copyright (c) 2021-2025 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("//build/test.gni") 15import( 16 "//foundation/distributedhardware/distributed_camera/distributedcamera.gni") 17 18module_out_path = "${unittest_output_path}/dcamera_source_test" 19 20config("module_private_config") { 21 visibility = [ ":*" ] 22 include_dirs = [ 23 "${services_path}/cameraservice/sourceservice/include/distributedcamera", 24 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr", 25 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcameracontrol", 26 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcameradata", 27 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcamerahdf", 28 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcamerainterface", 29 "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcamerastate", 30 "${services_path}/cameraservice/cameraoperator/client/include", 31 "${services_path}/cameraservice/base/include", 32 "${services_path}/channel/include", 33 "${services_path}/data_process/include/pipeline", 34 "${services_path}/data_process/include/interfaces", 35 "${services_path}/data_process/include/utils", 36 "${services_path}/data_process/include/eventbus", 37 "${common_path}/include/constants", 38 "${common_path}/include/utils", 39 40 "${innerkits_path}/native_cpp/camera_source/include", 41 "${innerkits_path}/native_cpp/camera_source/include/callback", 42 "${innerkits_path}/native_cpp/camera_sink/include", 43 ] 44} 45 46ohos_unittest("DCameraSourceTest") { 47 sanitize = { 48 cfi = true 49 cfi_cross_dso = true 50 debug = false 51 } 52 module_out_path = module_out_path 53 54 sources = [ 55 "dcamera_service_state_listener_test.cpp", 56 "dcamera_source_callback_proxy_test.cpp", 57 "dcamera_source_hidumper_test.cpp", 58 "distributed_camera_source_service_test.cpp", 59 "distributed_camera_source_stub_test.cpp", 60 "mock_distributed_hardware_fwk_kit.cpp", 61 "${innerkits_path}/native_cpp/camera_source/src/dcamera_hdf_operate.cpp", 62 ] 63 64 cflags = [ 65 "-Dprivate=public", 66 "-Dprotected=public", 67 ] 68 69 configs = [ ":module_private_config" ] 70 71 deps = [ 72 "${common_path}:distributed_camera_utils", 73 "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", 74 "${services_path}/cameraservice/sourceservice:distributed_camera_source", 75 "${services_path}/channel:distributed_camera_channel", 76 ] 77 78 external_deps = [ 79 "access_token:libaccesstoken_sdk", 80 "access_token:libnativetoken_shared", 81 "access_token:libtokensetproc_shared", 82 "cJSON:cjson", 83 "c_utils:utils", 84 "distributed_hardware_fwk:distributed_av_receiver", 85 "distributed_hardware_fwk:distributedhardwareutils", 86 "distributed_hardware_fwk:libdhfwk_sdk", 87 "drivers_interface_distributed_camera:libdistributed_camera_provider_proxy_1.1", 88 "dsoftbus:softbus_client", 89 "eventhandler:libeventhandler", 90 "graphic_surface:surface", 91 "hdf_core:libhdf_ipc_adapter", 92 "hdf_core:libhdi", 93 "hdf_core:libpub_utils", 94 "hicollie:libhicollie", 95 "hilog:libhilog", 96 "ipc:ipc_core", 97 "safwk:system_ability_fwk", 98 "samgr:samgr_proxy", 99 ] 100 101 defines = [ 102 "HI_LOG_ENABLE", 103 "DH_LOG_TAG=\"DCameraSourceTest\"", 104 "LOG_DOMAIN=0xD004150", 105 ] 106} 107 108group("dcamera_source_test") { 109 testonly = true 110 deps = [ ":DCameraSourceTest" ] 111} 112