• 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("GnssAbilityFuzzTest") {
21  module_out_path = "location/location"
22  fuzz_config_file =
23      "$LOCATION_ROOT_DIR/test/fuzztest/locator/gnssability_fuzzer"
24  include_dirs = [
25    "$LOCATION_GNSS_ROOT/include",
26    "$LOCATION_LOCATOR_ROOT/include",
27    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
28  ]
29  cflags = [
30    "-g",
31    "-O0",
32    "-Wno-unused-variable",
33    "-fno-omit-frame-pointer",
34  ]
35  sources = [ "gnssability_fuzzer.cpp" ]
36  deps = [
37    "$LOCATION_GNSS_ROOT:lbsservice_gnss_static",
38    "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static",
39    "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static",
40    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static",
41    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk_static",
42    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static",
43  ]
44  external_deps = [
45    "napi:ace_napi",
46    "safwk:system_ability_fwk",
47    "access_token:libaccesstoken_sdk",
48    "access_token:libnativetoken",
49    "access_token:libtoken_setproc",
50    "c_utils:utils",
51    "common_event_service:cesfwk_innerkits",
52    "core_service:tel_core_service_api",
53    "eventhandler:libeventhandler",
54    "ffrt:libffrt",
55    "hilog:libhilog",
56    "hisysevent:libhisysevent",
57    "init:libbegetutil",
58    "ipc:ipc_core",
59    "samgr:samgr_proxy",
60    "selinux_adapter:librestorecon",
61  ]
62
63  defines = []
64
65  if (telephony_core_service_enable) {
66    external_deps += [ "core_service:tel_core_service_api" ]
67    defines += [ "TEL_CORE_SERVICE_ENABLE" ]
68  }
69
70  if (telephony_cellular_data_enable) {
71    external_deps += [ "cellular_data:tel_cellular_data_api" ]
72    defines += [ "TEL_CELLULAR_DATA_ENABLE" ]
73  }
74
75  if (hdf_drivers_interface_location_agnss_enable) {
76    external_deps +=
77        [ "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0" ]
78    defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ]
79  }
80
81  if (location_feature_with_gnss &&
82      hdf_drivers_interface_location_gnss_enable) {
83    external_deps +=
84        [ "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0" ]
85    defines += [ "FEATURE_GNSS_SUPPORT" ]
86  }
87
88  if (hdf_drivers_interface_location_geofence_enable) {
89    external_deps +=
90        [ "drivers_interface_location_geofence:liblocation_geofence_proxy_2.0" ]
91    defines += [ "HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE" ]
92  }
93
94  if (location_feature_with_passive) {
95    defines += [ "FEATURE_PASSIVE_SUPPORT" ]
96  }
97}
98
99###############################################################################
100group("fuzztest") {
101  testonly = true
102  deps = []
103  deps += [
104    # deps file
105    ":GnssAbilityFuzzTest",
106  ]
107}
108###############################################################################
109