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###################
15import("//build/config/features.gni")
16import("//build/ohos.gni")
17import("//build/test.gni")
18SMS_MMS_SOURCE_DIR = "../../../"
19
20##############################fuzztest##########################################
21ohos_fuzztest("CdmaSmsEncodeFuzzTest") {
22  module_output_path = "sms_mms/sms_mms"
23  module_out_path = module_output_path
24  fuzz_config_file = "$SMS_MMS_SOURCE_DIR/test/fuzztest/cdmasmsencode_fuzzer"
25
26  include_dirs = [
27    "$SMS_MMS_SOURCE_DIR/frameworks/js/napi/include",
28    "$SMS_MMS_SOURCE_DIR/services/include",
29    "$SMS_MMS_SOURCE_DIR/test/fuzztest/common_fuzzer",
30    "$SMS_MMS_SOURCE_DIR/interfaces/innerkits/",
31    "$SMS_MMS_SOURCE_DIR/interfaces/innerkits/ims",
32    "//third_party/libphonenumber/cpp/src",
33    "//third_party/libphonenumber/cpp/src/phonenumbers",
34    "//third_party/protobuf/src",
35  ]
36
37  deps = [
38    "$SMS_MMS_SOURCE_DIR:tel_sms_mms",
39    "$SMS_MMS_SOURCE_DIR/frameworks/native:tel_sms_mms_api",
40    "//third_party/libphonenumber/cpp:phonenumber_standard",
41  ]
42
43  external_deps = [
44    "ability_runtime:ability_manager",
45    "ability_runtime:data_ability_helper",
46    "access_token:libaccesstoken_sdk",
47    "access_token:libnativetoken",
48    "access_token:libtoken_setproc",
49    "curl:curl_shared",
50    "c_utils:utils",
51    "common_event_service:cesfwk_innerkits",
52    "core_service:libtel_common",
53    "core_service:tel_core_service_api",
54    "data_share:datashare_consumer",
55    "eventhandler:libeventhandler",
56    "hilog:libhilog",
57    "ipc:ipc_single",
58    "napi:ace_napi",
59    "netmanager_base:net_conn_manager_if",
60    "netstack:http_client",
61    "telephony_data:tel_telephony_data",
62  ]
63  defines = [
64    "TELEPHONY_LOG_TAG = \"SmsMmsFuzzTest\"",
65    "LOG_DOMAIN = 0xD000F00",
66  ]
67
68  cflags = [
69    "-g",
70    "-O0",
71    "-Wno-unused-variable",
72    "-fno-omit-frame-pointer",
73  ]
74
75  sources = [
76    "$SMS_MMS_SOURCE_DIR/test/fuzztest/common_fuzzer/addsmstoken_fuzzer.cpp",
77    "cdmasmsencode_fuzzer.cpp",
78  ]
79}
80
81###############################################################################
82group("fuzztest") {
83  testonly = true
84  deps = []
85  deps += [
86    # deps file
87    ":CdmaSmsEncodeFuzzTest",
88  ]
89}
90###############################################################################
91