1# Copyright (c) 2021-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/drivers_peripheral_camera" 22 23config("camhdi_device_config") { 24 visibility = [ ":*" ] 25 cflags_cc = [ 26 "-DGST_DISABLE_DEPRECATED", 27 "-DHAVE_CONFIG_H", 28 "-DCOLORSPACE=\"videoconvert\"", 29 ] 30} 31 32ohos_fuzztest("camera_device_fuzztest") { 33 testonly = true 34 module_out_path = module_output_path 35 fuzz_config_file = "$camera_path/../../test/fuzztest/camera_device" 36 sources = [ 37 "../common/src/common.cpp", 38 "./camera_device_fuzzer.cpp", 39 ] 40 41 include_dirs = [ 42 # common includes 43 "../common/include", 44 "$camera_test_path/v1_2/include", 45 "$camera_path/../../interfaces/include", 46 "$camera_path/include", 47 ] 48 cflags = [ 49 "-g", 50 "-O0", 51 "-Wno-unused-variable", 52 "-fno-omit-frame-pointer", 53 ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "hdf_core:libhdf_host", 58 "hdf_core:libhdf_ipc_adapter", 59 "hdf_core:libhdf_utils", 60 "hdf_core:libhdi", 61 "hilog:libhilog", 62 "ipc:ipc_single", 63 ] 64 65 external_deps += [ 66 "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", 67 "drivers_interface_camera:libcamera_proxy_1.2", 68 "drivers_interface_camera:libcamera_proxy_1.3", 69 "drivers_interface_camera:metadata", 70 "graphic_surface:surface", 71 "samgr:samgr_proxy", 72 ] 73 public_configs = [ ":camhdi_device_config" ] 74} 75 76group("fuzztest") { 77 testonly = true 78 deps = [] 79 deps += [ 80 # dep file 81 ":camera_device_fuzztest", 82 ] 83} 84