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 
14 module_output_path = "updater/updater"
15 
16 import("//base/update/updater/updater_default_cfg.gni")
17 
18 #####################hydra-fuzz###################
19 import("//build/config/features.gni")
20 import("//build/test.gni")
21 updater_path = rebase_path("${updater_absolutely_path}", ".")
22 
23 ##############################fuzztest##########################################
24 ohos_fuzztest("RebootAndInstallUpgradePackageFuzzTest") {
25   defines = [
26     "UPDATER_UT",
27     "BUILD_OHOS",
28     "HDC_DEBUG",
29     "HDC_SUPPORT_FLASHD",
30     "HARMONY_PROJECT",
31   ]
32 
33   #configs = [ "${updater_path}/test/unittest:utest_config" ]
34   module_out_path = module_output_path
35   fuzz_config_file =
36       "${updater_path}/test/fuzztest/rebootandinstallupgradepackage_fuzzer"
37   include_dirs = [
38     "${updater_path}/interfaces/kits/include",
39     "${updater_path}/services/include/log",
40     "${updater_path}/utils/include",
41   ]
42 
43   deps = [
44     "${updater_path}/interfaces/kits/misc_info:libmiscinfo",
45     "${updater_path}/interfaces/kits/updaterkits:libupdaterkits",
46     "${updater_path}/services/log:libupdaterlog",
47     "${updater_path}/utils:libutils",
48   ]
49 
50   external_deps = [
51     "bounds_checking_function:libsec_static",
52     "c_utils:utils",
53     "init:libbegetutil_static",
54   ]
55 
56   cflags = [
57     "-g",
58     "-O0",
59     "-Wno-unused-variable",
60     "-fno-omit-frame-pointer",
61   ]
62   sources = [
63     "${updater_path}/interfaces/kits/updaterkits/updaterkits.cpp",
64     "rebootandinstallupgradepackage_fuzzer.cpp",
65   ]
66 }
67