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
14module_output_path = "updater/sys_installer"
15
16import("//base/update/sys_installer/sys_installer_default_cfg.gni")
17
18#####################hydra-fuzz###################
19import("//build/config/features.gni")
20import("//build/test.gni")
21sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".")
22
23##############################fuzztest##########################################
24ohos_fuzztest("ImoduleUpdateFuzzTest") {
25  module_out_path = module_output_path
26  fuzz_config_file = "${sys_installer_path}/test/fuzztest/imoduleupdate_fuzzer"
27  include_dirs = [
28    "${sys_installer_path}/interfaces/inner_api/include",
29    "${sys_installer_path}/interfaces/innerkits/ipc_client/include/",
30    "${sys_installer_path}/services/module_update/include",
31    "${sys_installer_path}/services/module_update/util/include",
32  ]
33
34  deps = [
35    "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits",
36    "${sys_installer_path}/services/module_update:module_update_utils",
37  ]
38
39  external_deps = [
40    "bounds_checking_function:libsec_static",
41    "c_utils:utils",
42    "hilog:libhilog",
43    "init:libbegetutil",
44    "ipc:ipc_core",
45    "safwk:system_ability_fwk",
46    "samgr:samgr_proxy",
47    "updater:libupdaterlog",
48    "updater:libutils",
49  ]
50
51  cflags = [
52    "-g",
53    "-O0",
54    "-Wno-unused-variable",
55    "-fno-omit-frame-pointer",
56  ]
57  sources = [
58    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_kits_impl.cpp",
59    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_load_callback.cpp",
60    "${sys_installer_path}/interfaces/innerkits/ipc_client/src/module_update_proxy.cpp",
61    "${sys_installer_path}/services/module_update/util/src/module_ipc_helper.cpp",
62    "imodule_update_fuzzer.cpp",
63  ]
64}
65