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("GnssStatusCallbackHostFuzzTest") {
21  module_out_path = "location/location"
22  fuzz_config_file =
23      "$LOCATION_ROOT_DIR/test/fuzztest/locator/gnssstatuscallbackhost_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 = [ "gnssstatuscallbackhost_fuzzer.cpp" ]
41  deps = [
42    "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static",
43    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static",
44    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk_static",
45    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static",
46    "$LOCATION_ROOT_DIR/services/location_geocode/geocode:lbsservice_geocode_static",
47    "$LOCATION_ROOT_DIR/services/location_gnss/gnss:lbsservice_gnss_static",
48    "$LOCATION_ROOT_DIR/services/location_locator/locator:lbsservice_locator_static",
49    "$LOCATION_ROOT_DIR/services/location_network/network:lbsservice_network_static",
50    "$LOCATION_ROOT_DIR/services/location_passive/passive:lbsservice_passive_static",
51    "//third_party/libuv:uv",
52  ]
53  external_deps = [
54    "access_token:libaccesstoken_sdk",
55    "access_token:libnativetoken",
56    "access_token:libtoken_setproc",
57    "c_utils:utils",
58    "common_event_service:cesfwk_innerkits",
59    "core_service:tel_core_service_api",
60    "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0",
61    "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0",
62    "eventhandler:libeventhandler",
63    "ffrt:libffrt",
64    "hilog:libhilog",
65    "hisysevent:libhisysevent",
66    "init:libbegetutil",
67    "ipc:ipc_core",
68    "napi:ace_napi",
69    "safwk:system_ability_fwk",
70    "samgr:samgr_proxy",
71  ]
72
73  defines = []
74  if (location_feature_with_geocode) {
75    defines += [ "FEATURE_GEOCODE_SUPPORT" ]
76  }
77
78  if (location_feature_with_gnss) {
79    defines += [ "FEATURE_GNSS_SUPPORT" ]
80  }
81
82  if (location_feature_with_network) {
83    defines += [ "FEATURE_NETWORK_SUPPORT" ]
84  }
85
86  if (location_feature_with_passive) {
87    defines += [ "FEATURE_PASSIVE_SUPPORT" ]
88  }
89}
90
91###############################################################################
92group("fuzztest") {
93  testonly = true
94  deps = []
95  deps += [
96    # deps file
97    ":GnssStatusCallbackHostFuzzTest",
98  ]
99}
100###############################################################################
101