• 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("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    "$LOCATION_GNSS_ROOT:lbsservice_gnss_static",
37    "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static",
38    "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static",
39    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static",
40    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk_static",
41    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static",
42  ]
43  external_deps = [
44    "napi:ace_napi",
45    "safwk:system_ability_fwk",
46    "access_token:libaccesstoken_sdk",
47    "c_utils:utils",
48    "common_event_service:cesfwk_innerkits",
49    "core_service:tel_core_service_api",
50    "eventhandler:libeventhandler",
51    "ffrt:libffrt",
52    "hilog:libhilog",
53    "hisysevent:libhisysevent",
54    "init:libbegetutil",
55    "ipc:ipc_core",
56    "samgr:samgr_proxy",
57  ]
58
59  defines = []
60
61  if (telephony_core_service_enable) {
62    external_deps += [ "core_service:tel_core_service_api" ]
63    defines += [ "TEL_CORE_SERVICE_ENABLE" ]
64  }
65
66  if (telephony_cellular_data_enable) {
67    external_deps += [ "cellular_data:tel_cellular_data_api" ]
68    defines += [ "TEL_CELLULAR_DATA_ENABLE" ]
69  }
70
71  if (hdf_drivers_interface_location_agnss_enable) {
72    external_deps +=
73        [ "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0" ]
74    defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ]
75  }
76
77  if (location_feature_with_gnss &&
78      hdf_drivers_interface_location_gnss_enable) {
79    external_deps +=
80        [ "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0" ]
81    defines += [ "FEATURE_GNSS_SUPPORT" ]
82  }
83
84  if (hdf_drivers_interface_location_geofence_enable) {
85    external_deps +=
86        [ "drivers_interface_location_geofence:liblocation_geofence_proxy_2.0" ]
87    defines += [ "HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE" ]
88  }
89
90  if (location_feature_with_passive) {
91    defines += [ "FEATURE_PASSIVE_SUPPORT" ]
92  }
93  if (notification_distributed_notification_service_enable) {
94    defines += [ "NOTIFICATION_ENABLE" ]
95  }
96}
97
98###############################################################################
99group("fuzztest") {
100  testonly = true
101  deps = []
102  deps += [
103    # deps file
104    ":GnssFuzzTest",
105  ]
106}
107###############################################################################
108