1# Copyright (c) 2021 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 14module_output_path = "updater/updater" 15 16import("//base/update/updater/updater_default_cfg.gni") 17 18#####################hydra-fuzz################### 19import("//build/config/features.gni") 20import("//build/test.gni") 21updater_path = rebase_path("${updater_absolutely_path}", ".") 22 23##############################fuzztest########################################## 24ohos_fuzztest("ExtractAndExecuteScriptFuzzTest") { 25 module_out_path = module_output_path 26 resource_config_file = 27 "${updater_path}/test/fuzztest/fuzz_src_data/ohos_test.xml" 28 fuzz_config_file = 29 "${updater_path}/test/fuzztest/extractandexecutescript_fuzzer" 30 include_dirs = [ 31 "${updater_path}/utils/include", 32 "${updater_path}/interfaces/kits/include/", 33 "${updater_path}/services/common", 34 "${updater_path}/services/include/package", 35 "${updater_path}/services/package/pkg_manager", 36 "${updater_path}/services/package/pkg_algorithm", 37 "${updater_path}/services/include/log", 38 "${updater_path}/services", 39 "${updater_path}/services/ui", 40 "${updater_path}/services/include", 41 "${updater_path}/services/include/script", 42 "${updater_path}/services/script/threadpool", 43 "${updater_path}/services/script/script_manager", 44 "${updater_path}/services/script/script_instruction", 45 ] 46 47 deps = [ 48 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 49 "${updater_path}/interfaces/kits/packages:libpackageExt", 50 "${updater_path}/services/applypatch:libapplypatch", 51 "${updater_path}/services/diffpatch/patch:libpatch", 52 "${updater_path}/services/fs_manager:libfsmanager", 53 "${updater_path}/services/log:libupdaterlog", 54 "${updater_path}/services/package:libupdaterpackage", 55 "${updater_path}/services/script:libupdaterscript", 56 "${updater_path}/services/ui:libui", 57 "${updater_path}/utils:libutils", 58 ] 59 external_deps = [ 60 "bounds_checking_function:libsec_static", 61 "bzip2:libbz2", 62 "c_utils:utils", 63 "libdrm:libdrm", 64 "lz4:liblz4_static", 65 "openssl:libcrypto_shared", 66 "openssl:libssl_static", 67 "zlib:libz", 68 ] 69 70 cflags = [ 71 "-g", 72 "-O0", 73 "-Wno-unused-variable", 74 "-fno-omit-frame-pointer", 75 ] 76 sources = [ "extractandexecutescript_fuzzer.cpp" ] 77} 78