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("NmeaMessageCallbackHostFuzzTest") { 21 module_out_path = "location/services" 22 fuzz_config_file = 23 "$LOCATION_ROOT_DIR/test/fuzztest/locator/nmeamessagecallbackhost_fuzzer" 24 include_dirs = [ 25 "$LOCATION_ROOT_DIR/frameworks/js/napi/include", 26 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 27 "$LOCATION_ROOT_DIR/services/location_locator/locator/include", 28 "$LOCATION_ROOT_DIR/services/location_locator/callback/include", 29 "$LOCATION_ROOT_DIR/services/location_network/network/include", 30 "$LOCATION_ROOT_DIR/services/location_passive/passive/include", 31 "$LOCATION_ROOT_DIR/services/location_geocode/geocode/include", 32 "$LOCATION_ROOT_DIR/services/location_gnss/gnss/include", 33 ] 34 cflags = [ 35 "-g", 36 "-O0", 37 "-Wno-unused-variable", 38 "-fno-omit-frame-pointer", 39 ] 40 sources = [ "nmeamessagecallbackhost_fuzzer.cpp" ] 41 deps = [ 42 "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static", 43 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", 44 "$LOCATION_ROOT_DIR/frameworks/native:locator_sdk", 45 "$LOCATION_ROOT_DIR/services/location_geocode/geocode:lbsservice_geocode", 46 "$LOCATION_ROOT_DIR/services/location_gnss/gnss:lbsservice_gnss", 47 "$LOCATION_ROOT_DIR/services/location_locator/locator:lbsservice_locator", 48 "$LOCATION_ROOT_DIR/services/location_network/network:lbsservice_network", 49 "$LOCATION_ROOT_DIR/services/location_passive/passive:lbsservice_passive", 50 "//third_party/libuv:uv", 51 ] 52 external_deps = [ 53 "access_token:libaccesstoken_sdk", 54 "access_token:libnativetoken", 55 "access_token:libtoken_setproc", 56 "c_utils:utils", 57 "common_event_service:cesfwk_innerkits", 58 "core_service:tel_core_service_api", 59 "drivers_interface_location_agnss:liblocation_agnss_proxy_1.0", 60 "drivers_interface_location_gnss:liblocation_gnss_proxy_1.0", 61 "eventhandler:libeventhandler", 62 "hilog:libhilog", 63 "hisysevent:libhisysevent", 64 "ipc:ipc_core", 65 "napi:ace_napi", 66 "safwk:system_ability_fwk", 67 "samgr:samgr_proxy", 68 ] 69 70 defines = [] 71 if (location_feature_with_geocode) { 72 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 73 } 74 75 if (location_feature_with_gnss) { 76 defines += [ "FEATURE_GNSS_SUPPORT" ] 77 } 78 79 if (location_feature_with_network) { 80 defines += [ "FEATURE_NETWORK_SUPPORT" ] 81 } 82 83 if (location_feature_with_passive) { 84 defines += [ "FEATURE_PASSIVE_SUPPORT" ] 85 } 86} 87 88############################################################################### 89group("fuzztest") { 90 testonly = true 91 deps = [] 92 deps += [ 93 # deps file 94 ":NmeaMessageCallbackHostFuzzTest", 95 ] 96} 97############################################################################### 98