1# Copyright (c) 2022 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") 18import("../../../callmanager.gni") 19CALL_MANAGER_PATH = "../../.." 20 21##############################fuzztest########################################## 22ohos_fuzztest("DistributedCommunicationFuzzTest") { 23 module_output_path = "call_manager/call_manager" 24 module_out_path = module_output_path 25 fuzz_config_file = 26 "${CALL_MANAGER_PATH}/test/fuzztest/distributedcommunication_fuzzer" 27 _cfi_blocklist_path = "../../cfi_blocklist.txt" 28 29 include_dirs = [ 30 "${CALL_MANAGER_PATH}/interfaces/innerkits", 31 "${CALL_MANAGER_PATH}/test/fuzztest/common_fuzzer", 32 ] 33 include_dirs += call_manager_include_dirs 34 35 deps = [ 36 "${CALL_MANAGER_PATH}/frameworks/native:tel_call_manager_api", 37 "//third_party/cJSON:cjson", 38 "//third_party/libphonenumber/cpp:phonenumber_standard", 39 ] 40 41 external_deps = [ 42 "access_token:libnativetoken", 43 "access_token:libtoken_setproc", 44 ] 45 external_deps += call_manager_external_deps 46 47 defines = [ 48 "TELEPHONY_LOG_TAG = \"CallManagerFuzzTest\"", 49 "LOG_DOMAIN = 0xD000F00", 50 "private = public", 51 "protected = public", 52 ] 53 defines += call_manager_defines 54 55 cflags = [ 56 "-g", 57 "-O0", 58 "-Wno-unused-variable", 59 "-fno-omit-frame-pointer", 60 "-flto", 61 "-fvisibility=hidden", 62 "-fsanitize=cfi", 63 "-fsanitize-cfi-cross-dso", 64 "-fsanitize-blacklist=" + rebase_path(_cfi_blocklist_path, root_build_dir), 65 ] 66 67 ldflags = [ 68 "-flto", 69 "-fsanitize=cfi", 70 "-fsanitize-cfi-cross-dso", 71 ] 72 73 sources = [ 74 "${CALL_MANAGER_PATH}/test/fuzztest/common_fuzzer/addcalltoken_fuzzer.cpp", 75 "distributed_communication_fuzzer.cpp", 76 ] 77 sources += call_manager_sources 78} 79 80############################################################################### 81group("fuzztest") { 82 testonly = true 83 deps = [] 84 deps += [ 85 # deps file 86 ":DistributedCommunicationFuzzTest", 87 ] 88} 89############################################################################### 90