• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ]
50  external_deps = [
51    "access_token:libaccesstoken_sdk",
52    "access_token:libnativetoken",
53    "access_token:libtoken_setproc",
54    "c_utils:utils",
55    "common_event_service:cesfwk_innerkits",
56    "eventhandler:libeventhandler",
57    "hilog:libhilog",
58    "hisysevent:libhisysevent",
59    "init:libbegetutil",
60    "ipc:ipc_core",
61    "napi:ace_napi",
62    "safwk:system_ability_fwk",
63    "samgr:samgr_proxy",
64    "libuv:uv",
65    "selinux_adapter:librestorecon",
66  ]
67
68  defines = []
69  if (location_feature_with_geocode) {
70    defines += [ "FEATURE_GEOCODE_SUPPORT" ]
71  }
72
73  if (location_feature_with_gnss) {
74    defines += [ "FEATURE_GNSS_SUPPORT" ]
75  }
76
77  if (location_feature_with_network) {
78    defines += [ "FEATURE_NETWORK_SUPPORT" ]
79  }
80
81  if (location_feature_with_passive) {
82    defines += [ "FEATURE_PASSIVE_SUPPORT" ]
83  }
84  if (i18n_enable) {
85    external_deps += [ "i18n:intl_util" ]
86    defines += [ "I18N_ENABLE" ]
87  }
88
89  if (telephony_core_service_enable) {
90    external_deps += [ "core_service:tel_core_service_api" ]
91    defines += [ "TEL_CORE_SERVICE_ENABLE" ]
92  }
93
94  if (telephony_cellular_data_enable) {
95    external_deps += [ "cellular_data:tel_cellular_data_api" ]
96    defines += [ "TEL_CELLULAR_DATA_ENABLE" ]
97  }
98
99  if (hdf_drivers_interface_location_agnss_enable) {
100    external_deps +=
101        [ "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0" ]
102    defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ]
103  }
104
105  if (location_feature_with_gnss &&
106      hdf_drivers_interface_location_gnss_enable) {
107    external_deps +=
108        [ "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0" ]
109    defines += [ "FEATURE_GNSS_SUPPORT" ]
110  }
111}
112
113###############################################################################
114group("fuzztest") {
115  testonly = true
116  deps = []
117  deps += [
118    # deps file
119    ":LocatorFuzzTest",
120  ]
121}
122###############################################################################
123