1# Copyright (c) 2022-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###################
15SUBSYSTEM_DIR = "../../../.."
16import("//build/config/features.gni")
17import("//build/ohos.gni")
18import("//build/test.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("SetShowNameFuzzTest") {
22  module_output_path = "core_service/core_service"
23  module_out_path = module_output_path
24  fuzz_config_file =
25      "$SUBSYSTEM_DIR/core_service/test/fuzztest/setshowname_fuzzer"
26
27  include_dirs = [
28    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/include",
29    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi",
30    "$SUBSYSTEM_DIR/core_service/utils/common/include",
31    "$SUBSYSTEM_DIR/core_service/services/core/include",
32    "$SUBSYSTEM_DIR/core_service/services/network_search/include",
33    "$SUBSYSTEM_DIR/core_service/services/sim/include",
34    "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer",
35    "$SUBSYSTEM_DIR/core_service/services/tel_ril/include",
36    "commonlibrary/c_utils/base/include",
37  ]
38
39  configs = [ "$SUBSYSTEM_DIR/core_service/utils:telephony_log_config" ]
40
41  deps = [
42    "$SUBSYSTEM_DIR/core_service:tel_core_service",
43    "$SUBSYSTEM_DIR/core_service/interfaces/innerkits:tel_core_service_api",
44    "$SUBSYSTEM_DIR/core_service/utils:libtel_common",
45  ]
46
47  external_deps = [
48    "ability_runtime:ability_manager",
49    "ability_runtime:data_ability_helper",
50    "access_token:libaccesstoken_sdk",
51    "access_token:libnativetoken",
52    "access_token:libtoken_setproc",
53    "c_utils:utils",
54    "drivers_interface_ril:ril_idl_headers",
55    "hdf_core:libhdi",
56    "hilog:libhilog",
57    "init:libbegetutil",
58    "ipc:ipc_single",
59    "napi:ace_napi",
60    "netmanager_base:net_conn_manager_if",
61    "netmanager_ext:net_tether_manager_if",
62    "power_manager:powermgr_client",
63    "samgr:samgr_proxy",
64  ]
65  defines = [
66    "TELEPHONY_LOG_TAG = \"CoreServiceFuzzTest\"",
67    "LOG_DOMAIN = 0xD000F00",
68  ]
69
70  cflags = [
71    "-g",
72    "-O0",
73    "-Wno-unused-variable",
74    "-fno-omit-frame-pointer",
75    "-flto",
76    "-fsanitize=cfi",
77    "-fsanitize-cfi-cross-dso",
78    "-fvisibility=hidden",
79  ]
80
81  ldflags = [
82    "-flto",
83    "-fsanitize=cfi",
84    "-fsanitize-cfi-cross-dso",
85  ]
86
87  sources = [
88    "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/napi_util.cpp",
89    "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer/addcoreservicetoken_fuzzer.cpp",
90    "setshowname_fuzzer.cpp",
91  ]
92}
93
94###############################################################################
95group("fuzztest") {
96  testonly = true
97  deps = []
98  deps += [
99    # deps file
100    ":SetShowNameFuzzTest",
101  ]
102}
103###############################################################################
104