1e1c44949Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd. 2e1c44949Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3e1c44949Sopenharmony_ci# you may not use this file except in compliance with the License. 4e1c44949Sopenharmony_ci# You may obtain a copy of the License at 5e1c44949Sopenharmony_ci# 6e1c44949Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7e1c44949Sopenharmony_ci# 8e1c44949Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9e1c44949Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10e1c44949Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11e1c44949Sopenharmony_ci# See the License for the specific language governing permissions and 12e1c44949Sopenharmony_ci# limitations under the License. 13e1c44949Sopenharmony_ci 14e1c44949Sopenharmony_ci#####################hydra-fuzz################### 15e1c44949Sopenharmony_ciimport("//build/config/features.gni") 16e1c44949Sopenharmony_ciimport("//build/ohos.gni") 17e1c44949Sopenharmony_ciimport("//build/test.gni") 18e1c44949Sopenharmony_ciimport("../../../callmanager.gni") 19e1c44949Sopenharmony_ciCALL_MANAGER_PATH = "../../.." 20e1c44949Sopenharmony_ci 21e1c44949Sopenharmony_ci##############################fuzztest########################################## 22e1c44949Sopenharmony_ciohos_fuzztest("IsEmergencyPhoneNumberFuzzTest") { 23e1c44949Sopenharmony_ci module_output_path = "call_manager/call_manager" 24e1c44949Sopenharmony_ci module_out_path = module_output_path 25e1c44949Sopenharmony_ci fuzz_config_file = 26e1c44949Sopenharmony_ci "${CALL_MANAGER_PATH}/test/fuzztest/isemergencyphonenumber_fuzzer" 27e1c44949Sopenharmony_ci _cfi_blocklist_path = "../../cfi_blocklist.txt" 28e1c44949Sopenharmony_ci 29e1c44949Sopenharmony_ci include_dirs = [ 30e1c44949Sopenharmony_ci "${CALL_MANAGER_PATH}/interfaces/innerkits", 31e1c44949Sopenharmony_ci "${CALL_MANAGER_PATH}/test/fuzztest/common_fuzzer", 32e1c44949Sopenharmony_ci ] 33e1c44949Sopenharmony_ci include_dirs += call_manager_include_dirs 34e1c44949Sopenharmony_ci 35e1c44949Sopenharmony_ci deps = [ 36e1c44949Sopenharmony_ci "${CALL_MANAGER_PATH}/frameworks/native:tel_call_manager_api", 37e1c44949Sopenharmony_ci "//third_party/cJSON:cjson", 38e1c44949Sopenharmony_ci "//third_party/libphonenumber/cpp:phonenumber_standard", 39e1c44949Sopenharmony_ci ] 40e1c44949Sopenharmony_ci 41e1c44949Sopenharmony_ci external_deps = [ 42e1c44949Sopenharmony_ci "access_token:libnativetoken", 43e1c44949Sopenharmony_ci "access_token:libtoken_setproc", 44e1c44949Sopenharmony_ci ] 45e1c44949Sopenharmony_ci external_deps += call_manager_external_deps 46e1c44949Sopenharmony_ci 47e1c44949Sopenharmony_ci defines = [ 48e1c44949Sopenharmony_ci "TELEPHONY_LOG_TAG = \"CallManagerFuzzTest\"", 49e1c44949Sopenharmony_ci "LOG_DOMAIN = 0xD000F00", 50e1c44949Sopenharmony_ci ] 51e1c44949Sopenharmony_ci defines += call_manager_defines 52e1c44949Sopenharmony_ci 53e1c44949Sopenharmony_ci cflags = [ 54e1c44949Sopenharmony_ci "-g", 55e1c44949Sopenharmony_ci "-O0", 56e1c44949Sopenharmony_ci "-Wno-unused-variable", 57e1c44949Sopenharmony_ci "-fno-omit-frame-pointer", 58e1c44949Sopenharmony_ci "-flto", 59e1c44949Sopenharmony_ci "-fvisibility=hidden", 60e1c44949Sopenharmony_ci "-fsanitize=cfi", 61e1c44949Sopenharmony_ci "-fsanitize-cfi-cross-dso", 62e1c44949Sopenharmony_ci "-fsanitize-blacklist=" + rebase_path(_cfi_blocklist_path, root_build_dir), 63e1c44949Sopenharmony_ci ] 64e1c44949Sopenharmony_ci 65e1c44949Sopenharmony_ci ldflags = [ 66e1c44949Sopenharmony_ci "-flto", 67e1c44949Sopenharmony_ci "-fsanitize=cfi", 68e1c44949Sopenharmony_ci "-fsanitize-cfi-cross-dso", 69e1c44949Sopenharmony_ci ] 70e1c44949Sopenharmony_ci 71e1c44949Sopenharmony_ci sources = [ 72e1c44949Sopenharmony_ci "${CALL_MANAGER_PATH}/test/fuzztest/common_fuzzer/addcalltoken_fuzzer.cpp", 73e1c44949Sopenharmony_ci "isemergencyphonenumber_fuzzer.cpp", 74e1c44949Sopenharmony_ci ] 75e1c44949Sopenharmony_ci sources += call_manager_sources 76e1c44949Sopenharmony_ci} 77e1c44949Sopenharmony_ci 78e1c44949Sopenharmony_ci############################################################################### 79e1c44949Sopenharmony_cigroup("fuzztest") { 80e1c44949Sopenharmony_ci testonly = true 81e1c44949Sopenharmony_ci deps = [] 82e1c44949Sopenharmony_ci deps += [ 83e1c44949Sopenharmony_ci # deps file 84e1c44949Sopenharmony_ci ":IsEmergencyPhoneNumberFuzzTest", 85e1c44949Sopenharmony_ci ] 86e1c44949Sopenharmony_ci} 87e1c44949Sopenharmony_ci############################################################################### 88