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