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
14#####################hydra-fuzz###################
15SUBSYSTEM_DIR = "../../../.."
16import("//build/config/features.gni")
17import("//build/ohos.gni")
18import("//build/test.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("TelephonyObserverFuzzTest") {
22  module_output_path = "state_registry/state_registry"
23  module_out_path = module_output_path
24  fuzz_config_file =
25      "$SUBSYSTEM_DIR/state_registry/test/fuzztest/telephonyobserver_fuzzer"
26
27  include_dirs = [
28    "$SUBSYSTEM_DIR/state_registry/interfaces/innerkits/observer",
29    "$SUBSYSTEM_DIR/state_registry/services/include",
30    "$SUBSYSTEM_DIR/state_registry/test/fuzztest/common_fuzzer",
31  ]
32
33  deps = [
34    "$SUBSYSTEM_DIR/state_registry:tel_state_registry",
35    "$SUBSYSTEM_DIR/state_registry/frameworks/native/observer:tel_state_registry_api",
36  ]
37
38  external_deps = [
39    "ability_base:want",
40    "access_token:libaccesstoken_sdk",
41    "access_token:libnativetoken",
42    "access_token:libtoken_setproc",
43    "c_utils:utils",
44    "call_manager:tel_call_manager_api",
45    "common_event_service:cesfwk_innerkits",
46    "core_service:libtel_common",
47    "core_service:tel_core_service_api",
48    "hilog:libhilog",
49    "init:libbegetutil",
50    "ipc:ipc_single",
51    "safwk:system_ability_fwk",
52    "samgr:samgr_proxy",
53  ]
54
55  cflags = [
56    "-g",
57    "-O0",
58    "-Wno-unused-variable",
59    "-fno-omit-frame-pointer",
60  ]
61  sources = [
62    "$SUBSYSTEM_DIR/state_registry/test/fuzztest/common_fuzzer/addstateregistrytoken_fuzzer.cpp",
63    "telephonyobserver_fuzzer.cpp",
64  ]
65}
66
67###############################################################################
68group("fuzztest") {
69  testonly = true
70  deps = []
71  deps += [
72    # deps file
73    ":TelephonyObserverFuzzTest",
74  ]
75}
76###############################################################################
77