1# Copyright (c) 2024 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/ohos.gni") 17import("//build/test.gni") 18import("//foundation/filemanagement/dfs_service/distributedfile.gni") 19ohos_fuzztest("CloudSyncServiceStubFuzzTest") { 20 module_out_path = "dfs_service/dfs_service" 21 fuzz_config_file = 22 "${distributedfile_path}/test/fuzztest/cloudsyncservicestub_fuzzer" 23 include_dirs = [ 24 "${distributedfile_path}/test/fuzztest/fuzz_common", 25 "${innerkits_native_path}/cloudsync_kit_inner", 26 "${media_library_path}/interfaces/inner_api/media_library_helper/include", 27 "${services_path}/cloudsyncservice/include", 28 "${services_path}/cloudsyncservice/include/cycle_task", 29 "${services_path}/cloudsyncservice/include/cycle_task/tasks", 30 "${services_path}/cloudsyncservice/include/data_sync", 31 "${services_path}/cloudsyncservice/include/data_sync/cloud_disk_data_sync", 32 "${services_path}/cloudsyncservice/include/data_sync/gallery_data_sync", 33 "${services_path}/cloudsyncservice/include/ipc", 34 "${services_path}/cloudsyncservice/include/sync_rule", 35 "${services_path}/cloudsyncservice/include/transport", 36 "${services_path}/cloudsyncservice/include/transport/softbus", 37 "${utils_path}/dentry/include", 38 ] 39 cflags = [ 40 "-g", 41 "-O0", 42 "-Wno-unused-variable", 43 "-fno-omit-frame-pointer", 44 "-flto", 45 "-fvisibility=hidden", 46 "-Dprivate=public", 47 "--coverage", 48 ] 49 ldflags = [ 50 "-flto", 51 "--coverage", 52 ] 53 sources = [ 54 "${distributedfile_path}/test/fuzztest/cloudsyncservicestub_fuzzer/cloudsyncservicestub_fuzzer.cpp", 55 "${services_path}/cloudsyncservice/src/ipc/cloud_sync_service_stub.cpp", 56 ] 57 58 deps = [ 59 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 60 "${services_path}/cloudsyncservice:cloudsync_sa_static", 61 "${utils_path}:libdistributedfileutils_lite", 62 ] 63 64 external_deps = [ 65 "ability_base:want", 66 "access_token:libaccesstoken_sdk", 67 "access_token:libnativetoken_shared", 68 "access_token:libtokensetproc_shared", 69 "c_utils:utils", 70 "device_manager:devicemanagersdk", 71 "ffrt:libffrt", 72 "hilog:libhilog", 73 "ipc:ipc_single", 74 "safwk:system_ability_fwk", 75 "samgr:samgr_proxy", 76 ] 77} 78 79group("fuzztest") { 80 testonly = true 81 deps = [ ":CloudSyncServiceStubFuzzTest" ] 82} 83