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