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