15c735df2Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
25c735df2Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
35c735df2Sopenharmony_ci# you may not use this file except in compliance with the License.
45c735df2Sopenharmony_ci# You may obtain a copy of the License at
55c735df2Sopenharmony_ci#
65c735df2Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
75c735df2Sopenharmony_ci#
85c735df2Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
95c735df2Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
105c735df2Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115c735df2Sopenharmony_ci# See the License for the specific language governing permissions and
125c735df2Sopenharmony_ci# limitations under the License.
135c735df2Sopenharmony_ci
145c735df2Sopenharmony_ci#####################hydra-fuzz###################
155c735df2Sopenharmony_ciimport("//base/location/config.gni")
165c735df2Sopenharmony_ciimport("//build/config/features.gni")
175c735df2Sopenharmony_ciimport("//build/test.gni")
185c735df2Sopenharmony_ci
195c735df2Sopenharmony_ci##############################fuzztest##########################################
205c735df2Sopenharmony_ciohos_fuzztest("GnssFuzzTest") {
215c735df2Sopenharmony_ci  module_out_path = "location/location"
225c735df2Sopenharmony_ci  fuzz_config_file = "$LOCATION_ROOT_DIR/test/fuzztest/locator/gnss_fuzzer"
235c735df2Sopenharmony_ci  include_dirs = [
245c735df2Sopenharmony_ci    "$LOCATION_GNSS_ROOT/include",
255c735df2Sopenharmony_ci    "$LOCATION_LOCATOR_ROOT/include",
265c735df2Sopenharmony_ci    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
275c735df2Sopenharmony_ci  ]
285c735df2Sopenharmony_ci  cflags = [
295c735df2Sopenharmony_ci    "-g",
305c735df2Sopenharmony_ci    "-O0",
315c735df2Sopenharmony_ci    "-Wno-unused-variable",
325c735df2Sopenharmony_ci    "-fno-omit-frame-pointer",
335c735df2Sopenharmony_ci  ]
345c735df2Sopenharmony_ci  sources = [ "gnss_fuzzer.cpp" ]
355c735df2Sopenharmony_ci  deps = [
365c735df2Sopenharmony_ci    "$ARKUI_ROOT_DIR/napi:ace_napi",
375c735df2Sopenharmony_ci    "$LOCATION_GNSS_ROOT:lbsservice_gnss_static",
385c735df2Sopenharmony_ci    "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static",
395c735df2Sopenharmony_ci    "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static",
405c735df2Sopenharmony_ci    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static",
415c735df2Sopenharmony_ci    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk_static",
425c735df2Sopenharmony_ci    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static",
435c735df2Sopenharmony_ci    "$SAMGR_ROOT_DIR/safwk/interfaces/innerkits/safwk:system_ability_fwk",
445c735df2Sopenharmony_ci  ]
455c735df2Sopenharmony_ci  external_deps = [
465c735df2Sopenharmony_ci    "access_token:libaccesstoken_sdk",
475c735df2Sopenharmony_ci    "c_utils:utils",
485c735df2Sopenharmony_ci    "common_event_service:cesfwk_innerkits",
495c735df2Sopenharmony_ci    "core_service:tel_core_service_api",
505c735df2Sopenharmony_ci    "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0",
515c735df2Sopenharmony_ci    "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0",
525c735df2Sopenharmony_ci    "eventhandler:libeventhandler",
535c735df2Sopenharmony_ci    "ffrt:libffrt",
545c735df2Sopenharmony_ci    "hilog:libhilog",
555c735df2Sopenharmony_ci    "hisysevent:libhisysevent",
565c735df2Sopenharmony_ci    "init:libbegetutil",
575c735df2Sopenharmony_ci    "ipc:ipc_core",
585c735df2Sopenharmony_ci    "samgr:samgr_proxy",
595c735df2Sopenharmony_ci  ]
605c735df2Sopenharmony_ci
615c735df2Sopenharmony_ci  defines = []
625c735df2Sopenharmony_ci
635c735df2Sopenharmony_ci  if (telephony_core_service_enable) {
645c735df2Sopenharmony_ci    external_deps += [ "core_service:tel_core_service_api" ]
655c735df2Sopenharmony_ci    defines += [ "TEL_CORE_SERVICE_ENABLE" ]
665c735df2Sopenharmony_ci  }
675c735df2Sopenharmony_ci
685c735df2Sopenharmony_ci  if (telephony_cellular_data_enable) {
695c735df2Sopenharmony_ci    external_deps += [ "cellular_data:tel_cellular_data_api" ]
705c735df2Sopenharmony_ci    defines += [ "TEL_CELLULAR_DATA_ENABLE" ]
715c735df2Sopenharmony_ci  }
725c735df2Sopenharmony_ci
735c735df2Sopenharmony_ci  if (hdf_drivers_interface_location_agnss_enable) {
745c735df2Sopenharmony_ci    external_deps +=
755c735df2Sopenharmony_ci        [ "drivers_interface_location_agnss:liblocation_agnss_proxy_2.0" ]
765c735df2Sopenharmony_ci    defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ]
775c735df2Sopenharmony_ci  }
785c735df2Sopenharmony_ci
795c735df2Sopenharmony_ci  if (location_feature_with_gnss &&
805c735df2Sopenharmony_ci      hdf_drivers_interface_location_gnss_enable) {
815c735df2Sopenharmony_ci    external_deps +=
825c735df2Sopenharmony_ci        [ "drivers_interface_location_gnss:liblocation_gnss_proxy_2.0" ]
835c735df2Sopenharmony_ci    defines += [ "FEATURE_GNSS_SUPPORT" ]
845c735df2Sopenharmony_ci  }
855c735df2Sopenharmony_ci
865c735df2Sopenharmony_ci  if (hdf_drivers_interface_location_geofence_enable) {
875c735df2Sopenharmony_ci    external_deps +=
885c735df2Sopenharmony_ci        [ "drivers_interface_location_geofence:liblocation_geofence_proxy_2.0" ]
895c735df2Sopenharmony_ci    defines += [ "HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE" ]
905c735df2Sopenharmony_ci  }
915c735df2Sopenharmony_ci
925c735df2Sopenharmony_ci  if (location_feature_with_passive) {
935c735df2Sopenharmony_ci    defines += [ "FEATURE_PASSIVE_SUPPORT" ]
945c735df2Sopenharmony_ci  }
955c735df2Sopenharmony_ci  if (notification_distributed_notification_service_enable) {
965c735df2Sopenharmony_ci    defines += [ "NOTIFICATION_ENABLE" ]
975c735df2Sopenharmony_ci  }
985c735df2Sopenharmony_ci}
995c735df2Sopenharmony_ci
1005c735df2Sopenharmony_ci###############################################################################
1015c735df2Sopenharmony_cigroup("fuzztest") {
1025c735df2Sopenharmony_ci  testonly = true
1035c735df2Sopenharmony_ci  deps = []
1045c735df2Sopenharmony_ci  deps += [
1055c735df2Sopenharmony_ci    # deps file
1065c735df2Sopenharmony_ci    ":GnssFuzzTest",
1075c735df2Sopenharmony_ci  ]
1085c735df2Sopenharmony_ci}
1095c735df2Sopenharmony_ci###############################################################################
110