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 17import("//build/ohos.gni") 18import("//build/test.gni") 19 20module_output_path = "drivers_peripheral_camera/camera" 21 22config("camhdi_at_test_config") { 23 visibility = [ ":*" ] 24 cflags_cc = [ 25 "-DGST_DISABLE_DEPRECATED", 26 "-DHAVE_CONFIG_H", 27 "-DCOLORSPACE=\"videoconvert\"", 28 ] 29 if (enable_camera_coverage) { 30 cflags_cc += [ "--coverage" ] 31 ldflags = [ "--coverage" ] 32 } 33} 34 35ohos_unittest("camera_metadata_operator_ut") { 36 testonly = true 37 module_out_path = module_output_path 38 sources = [ 39 "$camera_test_path/metadata_test/src/camera_error_log_detector.cpp", 40 "$camera_test_path/metadata_test/src/camera_example_vendor_tags_uttest.cpp", 41 "$camera_test_path/metadata_test/src/camera_metadata_enum_uttest.cpp", 42 "$camera_test_path/metadata_test/src/camera_metadata_info_uttest.cpp", 43 "$camera_test_path/metadata_test/src/camera_metadata_operator_uttest.cpp", 44 "$camera_test_path/metadata_test/src/camera_metadata_utils_uttest.cpp", 45 ] 46 47 include_dirs = [ 48 # common includes 49 "$camera_test_path/metadata_test/include", 50 "$camera_path/../../interfaces/include", 51 "$camera_path/metadata_manager/include", 52 "$camera_path/include", 53 ] 54 55 deps = [] 56 57 if (is_standard_system) { 58 external_deps = [ 59 "c_utils:utils", 60 "hdf_core:libhdf_host", 61 "hdf_core:libhdf_ipc_adapter", 62 "hdf_core:libhdf_utils", 63 "hdf_core:libhdi", 64 "hilog:libhilog", 65 "ipc:ipc_single", 66 ] 67 } else { 68 external_deps = [ "hilog:libhilog" ] 69 } 70 71 external_deps += [ 72 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 73 "drivers_interface_camera:libcamera_proxy_1.0", 74 "drivers_interface_camera:libcamera_proxy_1.3", 75 "drivers_interface_camera:metadata", 76 "googletest:gmock_main", 77 "googletest:gtest", 78 "googletest:gtest_main", 79 "graphic_surface:surface", 80 "samgr:samgr_proxy", 81 ] 82 public_configs = [ ":camhdi_at_test_config" ] 83} 84