1# Copyright (C) 2023 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 14import("//base/location/config.gni") 15import("//build/test.gni") 16 17module_output_path = "location/service" 18 19MOCK_IPC_UNIT_TEST_DIR = "$LOCATION_ROOT_DIR/test/location_mock_ipc" 20ohos_unittest("LocationMockIpcTest") { 21 module_out_path = module_output_path 22 sources = [ 23 "$LOCATION_ROOT_DIR/test/mock/src/mock_ipc.cpp", 24 "$MOCK_IPC_UNIT_TEST_DIR/src/location_mock_ipc.cpp", 25 ] 26 27 include_dirs = [ 28 "$MOCK_IPC_UNIT_TEST_DIR/include", 29 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 30 "$LOCATION_GNSS_ROOT/include", 31 "$LOCATION_NETWORK_ROOT/include", 32 "$LOCATION_GEOCONVERT_ROOT/include", 33 "$LOCATION_PASSIVE_ROOT/include", 34 "$LOCATION_LOCATOR_ROOT/include", 35 ] 36 37 deps = [ 38 "$GOOGLE_TEST_DIR:gmock_main", 39 "$GOOGLE_TEST_DIR:gtest_main", 40 "$LOCATION_GEOCONVERT_ROOT:lbsservice_geocode", 41 "$LOCATION_GNSS_ROOT:lbsservice_gnss", 42 "$LOCATION_LOCATOR_ROOT:lbsservice_locator", 43 "$LOCATION_NETWORK_ROOT:lbsservice_network", 44 "$LOCATION_PASSIVE_ROOT:lbsservice_passive", 45 "$LOCATION_ROOT_DIR/frameworks/native:locator_sdk", 46 ] 47 48 external_deps = [ 49 "ability_base:want", 50 "ability_runtime:app_manager", 51 "access_token:libaccesstoken_sdk", 52 "access_token:libnativetoken", 53 "access_token:libtoken_setproc", 54 "bundle_framework:appexecfwk_core", 55 "c_utils:utils", 56 "cellular_data:tel_cellular_data_api", 57 "common_event_service:cesfwk_innerkits", 58 "core_service:tel_core_service_api", 59 "drivers_interface_location_agnss:liblocation_agnss_proxy_1.0", 60 "drivers_interface_location_gnss:liblocation_gnss_proxy_1.0", 61 "eventhandler:libeventhandler", 62 "hdf_core:libhdi", 63 "hdf_core:libpub_utils", 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 75 if (telephony_core_service_enable) { 76 external_deps += [ "core_service:tel_core_service_api" ] 77 defines += [ "TEL_CORE_SERVICE_ENABLE" ] 78 } 79 80 if (telephony_cellular_data_enable) { 81 external_deps += [ "cellular_data:tel_cellular_data_api" ] 82 defines += [ "TEL_CELLULAR_DATA_ENABLE" ] 83 } 84 85 if (hdf_drivers_interface_location_agnss_enable) { 86 external_deps += 87 [ "drivers_interface_location_agnss:liblocation_agnss_proxy_1.0" ] 88 defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ] 89 } 90 91 if (location_feature_with_gnss && 92 hdf_drivers_interface_location_gnss_enable) { 93 external_deps += 94 [ "drivers_interface_location_gnss:liblocation_gnss_proxy_1.0" ] 95 defines += [ "FEATURE_GNSS_SUPPORT" ] 96 } 97 98 if (location_feature_with_passive) { 99 defines += [ "FEATURE_PASSIVE_SUPPORT" ] 100 } 101 102 if (location_feature_with_geocode) { 103 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 104 } 105 106 if (location_feature_with_network) { 107 defines += [ "FEATURE_NETWORK_SUPPORT" ] 108 } 109 110 module_out_path = module_output_path 111} 112 113group("unittest") { 114 testonly = true 115 deps = [] 116 117 deps += [ ":LocationMockIpcTest" ] 118} 119