1# Copyright (c) 2023-2024 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("AutoTimeZoneFuzzTest") { 22 module_output_path = "core_service/core_service" 23 module_out_path = module_output_path 24 fuzz_config_file = 25 "$SUBSYSTEM_DIR/core_service/test/fuzztest/autotimezone_fuzzer" 26 27 include_dirs = [ 28 "$SUBSYSTEM_DIR/core_service/services/core/include", 29 "$SUBSYSTEM_DIR/core_service/services/telephony_ext_wrapper/include", 30 "$SUBSYSTEM_DIR/core_service/services/network_search/include", 31 "$SUBSYSTEM_DIR/core_service/services/sim/include", 32 "$SUBSYSTEM_DIR/core_service/services/tel_ril/include", 33 "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer", 34 ] 35 36 configs = [ "$SUBSYSTEM_DIR/core_service/utils:telephony_log_config" ] 37 38 deps = [ 39 "$SUBSYSTEM_DIR/core_service:tel_core_service", 40 "$SUBSYSTEM_DIR/core_service/interfaces/innerkits:tel_core_service_api", 41 ] 42 43 external_deps = [ 44 "ability_base:want", 45 "ability_base:zuri", 46 "ability_runtime:ability_manager", 47 "ability_runtime:data_ability_helper", 48 "ability_runtime:wantagent_innerkits", 49 "access_token:libaccesstoken_sdk", 50 "access_token:libnativetoken", 51 "access_token:libtoken_setproc", 52 "battery_manager:batterysrv_client", 53 "c_utils:utils", 54 "common_event_service:cesfwk_innerkits", 55 "config_policy:configpolicy_util", 56 "data_share:datashare_common", 57 "data_share:datashare_consumer", 58 "drivers_interface_ril:libril_proxy_1.1", 59 "eventhandler:libeventhandler", 60 "hdf_core:libhdi", 61 "hdf_core:libpub_utils", 62 "hilog:libhilog", 63 "hisysevent:libhisysevent", 64 "i18n:intl_util", 65 "i18n:zone_util", 66 "init:libbegetutil", 67 "ipc:ipc_single", 68 "napi:ace_napi", 69 "netmanager_base:net_conn_manager_if", 70 "netmanager_ext:net_tether_manager_if", 71 "power_manager:powermgr_client", 72 "safwk:system_ability_fwk", 73 "samgr:samgr_proxy", 74 ] 75 defines = [ 76 "TELEPHONY_LOG_TAG = \"CoreServiceFuzzTest\"", 77 "LOG_DOMAIN = 0xD000F00", 78 ] 79 80 if (defined(global_parts_info) && 81 defined(global_parts_info.location_location) && 82 global_parts_info.location_location) { 83 external_deps += [ 84 "location:lbsservice_common", 85 "location:locator_sdk", 86 ] 87 defines += [ "ABILITY_LOCATION_SUPPORT" ] 88 } 89 90 cflags = [ 91 "-g", 92 "-O0", 93 "-Wno-unused-variable", 94 "-fno-omit-frame-pointer", 95 "-flto", 96 "-fsanitize=cfi", 97 "-fsanitize-cfi-cross-dso", 98 "-fvisibility=hidden", 99 ] 100 101 ldflags = [ 102 "-flto", 103 "-fsanitize=cfi", 104 "-fsanitize-cfi-cross-dso", 105 ] 106 107 sources = [ 108 "$SUBSYSTEM_DIR/core_service/test/fuzztest/common_fuzzer/addcoreservicetoken_fuzzer.cpp", 109 "autotimezone_fuzzer.cpp", 110 ] 111} 112 113############################################################################### 114group("fuzztest") { 115 testonly = true 116 deps = [] 117 deps += [ 118 # deps file 119 ":AutoTimeZoneFuzzTest", 120 ] 121} 122############################################################################### 123