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("//base/location/config.gni") 16import("//build/config/features.gni") 17import("//build/test.gni") 18 19##############################fuzztest########################################## 20ohos_fuzztest("LocatorFuzzTest") { 21 module_out_path = "location/location" 22 fuzz_config_file = "$LOCATION_ROOT_DIR/test/fuzztest/locator/locator_fuzzer" 23 include_dirs = [ 24 "$LOCATION_ROOT_DIR/frameworks/js/napi/include", 25 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 26 "$LOCATION_ROOT_DIR/services/location_locator/locator/include", 27 "$LOCATION_ROOT_DIR/services/location_locator/callback/include", 28 "$LOCATION_ROOT_DIR/services/location_network/network/include", 29 "$LOCATION_ROOT_DIR/services/location_passive/passive/include", 30 "$LOCATION_ROOT_DIR/services/location_geocode/geocode/include", 31 "$LOCATION_ROOT_DIR/services/location_gnss/gnss/include", 32 ] 33 cflags = [ 34 "-g", 35 "-O0", 36 "-Wno-unused-variable", 37 "-fno-omit-frame-pointer", 38 ] 39 sources = [ "locator_fuzzer.cpp" ] 40 deps = [ 41 "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static", 42 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static", 43 "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static", 44 "$LOCATION_ROOT_DIR/services/location_geocode/geocode:lbsservice_geocode_static", 45 "$LOCATION_ROOT_DIR/services/location_gnss/gnss:lbsservice_gnss_static", 46 "$LOCATION_ROOT_DIR/services/location_locator/locator:lbsservice_locator_static", 47 "$LOCATION_ROOT_DIR/services/location_network/network:lbsservice_network_static", 48 "$LOCATION_ROOT_DIR/services/location_passive/passive:lbsservice_passive_static", 49 "//third_party/libuv:uv", 50 ] 51 external_deps = [ 52 "access_token:libaccesstoken_sdk", 53 "access_token:libnativetoken", 54 "access_token:libtoken_setproc", 55 "c_utils:utils", 56 "common_event_service:cesfwk_innerkits", 57 "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0", 58 "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0", 59 "eventhandler:libeventhandler", 60 "hilog:libhilog", 61 "hisysevent:libhisysevent", 62 "init:libbegetutil", 63 "ipc:ipc_core", 64 "napi:ace_napi", 65 "safwk:system_ability_fwk", 66 "samgr:samgr_proxy", 67 ] 68 69 defines = [] 70 if (location_feature_with_geocode) { 71 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 72 } 73 74 if (location_feature_with_gnss) { 75 defines += [ "FEATURE_GNSS_SUPPORT" ] 76 } 77 78 if (location_feature_with_network) { 79 defines += [ "FEATURE_NETWORK_SUPPORT" ] 80 } 81 82 if (location_feature_with_passive) { 83 defines += [ "FEATURE_PASSIVE_SUPPORT" ] 84 } 85 if (i18n_enable) { 86 external_deps += [ "i18n:intl_util" ] 87 defines += [ "I18N_ENABLE" ] 88 } 89 90 if (telephony_core_service_enable) { 91 external_deps += [ "core_service:tel_core_service_api" ] 92 defines += [ "TEL_CORE_SERVICE_ENABLE" ] 93 } 94 95 if (telephony_cellular_data_enable) { 96 external_deps += [ "cellular_data:tel_cellular_data_api" ] 97 defines += [ "TEL_CELLULAR_DATA_ENABLE" ] 98 } 99} 100 101############################################################################### 102group("fuzztest") { 103 testonly = true 104 deps = [] 105 deps += [ 106 # deps file 107 ":LocatorFuzzTest", 108 ] 109} 110############################################################################### 111