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("SmsPduBufferFuzzTest") {
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/smspdubuffer_fuzzer"
25
26  include_dirs = [
27    "$SMS_MMS_SOURCE_DIR/services/include",
28    "$SMS_MMS_SOURCE_DIR/test/fuzztest/common_fuzzer",
29  ]
30
31  deps = [ "$SMS_MMS_SOURCE_DIR:tel_sms_mms" ]
32
33  external_deps = [
34    "access_token:libaccesstoken_sdk",
35    "access_token:libnativetoken",
36    "access_token:libtoken_setproc",
37    "c_utils:utils",
38    "hilog:libhilog",
39  ]
40  defines = [
41    "TELEPHONY_LOG_TAG = \"SmsMmsFuzzTest\"",
42    "LOG_DOMAIN = 0xD000F00",
43  ]
44
45  cflags = [
46    "-g",
47    "-O0",
48    "-Wno-unused-variable",
49    "-fno-omit-frame-pointer",
50    "-flto",
51    "-fsanitize=cfi",
52    "-fsanitize-cfi-cross-dso",
53    "-fvisibility=hidden",
54  ]
55
56  ldflags = [
57    "-flto",
58    "-fsanitize=cfi",
59    "-fsanitize-cfi-cross-dso",
60  ]
61
62  sources = [
63    "$SMS_MMS_SOURCE_DIR/test/fuzztest/common_fuzzer/addsmstoken_fuzzer.cpp",
64    "smspdubuffer_fuzzer.cpp",
65  ]
66}
67
68###############################################################################
69group("fuzztest") {
70  testonly = true
71  deps = []
72  deps += [
73    # deps file
74    ":SmsPduBufferFuzzTest",
75  ]
76}
77###############################################################################
78