# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #####################hydra-fuzz################### import("//build/config/features.gni") import("//build/test.gni") import("//foundation/filemanagement/app_file_service/app_file_service.gni") import("//foundation/filemanagement/app_file_service/backup.gni") ##############################fuzztest########################################## ohos_fuzztest("BackupExtFuzzTest") { module_out_path = "app_file_service/app_file_service" fuzz_config_file = "${app_file_service_path}/test/fuzztest/backupext_fuzzer" include_dirs = [ "${path_ability_runtime}/services/common/include", "${path_ability_runtime}/interfaces/kits/native/appkit/ability_runtime", "${path_backup}/frameworks/native/backup_ext/include", "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl", "${path_backup}/utils/include", ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] sources = [ "${path_backup}/frameworks/native/backup_ext/src/ext_backup.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_backup_context.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_backup_context_js.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_backup_js.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_backup_loader.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_extension.cpp", "${path_backup}/frameworks/native/backup_ext/src/ext_extension_stub.cpp", "${path_backup}/frameworks/native/backup_ext/src/sub_ext_extension.cpp", "${path_backup}/frameworks/native/backup_ext/src/tar_file.cpp", "${path_backup}/frameworks/native/backup_ext/src/untar_file.cpp", "backupext_fuzzer.cpp", ] deps = [ "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner", "${path_backup}/interfaces/innerkits/native:sandbox_helper_native", "${path_backup}/utils:backup_utils", ] external_deps = [ "ability_base:want", "ability_runtime:ability_context_native", "ability_runtime:abilitykit_native", "ability_runtime:app_context", "ability_runtime:appkit_native", "ability_runtime:runtime", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_core", "c_utils:utils", "hilog:libhilog", "hitrace:hitrace_meter", "ipc:ipc_core", "jsoncpp:jsoncpp", "napi:ace_napi", ] defines = [ "LOG_TAG=\"app_file_service\"", "LOG_DOMAIN=0xD004303", "private = public", ] use_exceptions = true } ###############################################################################