1# Copyright (C) 2022-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 19if (location_feature_with_gnss) { 20 GNSS_UNIT_TEST_DIR = "$LOCATION_ROOT_DIR/test/location_gnss" 21 ohos_unittest("GnssAbilityTest") { 22 module_out_path = module_output_path 23 sources = [ 24 "$GNSS_UNIT_TEST_DIR/mock/src/mock_i_cellular_data_manager.cpp", 25 "$GNSS_UNIT_TEST_DIR/source/gnss_ability_stub_test.cpp", 26 "$GNSS_UNIT_TEST_DIR/source/gnss_ability_test.cpp", 27 "$LOCATION_ROOT_DIR/test/mock/src/mock_service_registry.cpp", 28 ] 29 30 include_dirs = [ 31 "$GNSS_UNIT_TEST_DIR/include", 32 "$GNSS_UNIT_TEST_DIR/mock/include", 33 "$LOCATION_GNSS_ROOT/include", 34 "$LOCATION_LOCATOR_ROOT/include", 35 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 36 "$LOCATION_ROOT_DIR/test/mock/include", 37 ] 38 39 deps = [ 40 "$ARKUI_ROOT_DIR/napi:ace_napi", 41 "$GOOGLE_TEST_DIR:gmock_main", 42 "$GOOGLE_TEST_DIR:gtest_main", 43 "$IPC_ROOT_DIR/interfaces/innerkits/ipc_core:ipc_core", 44 "$LOCATION_GNSS_ROOT:lbsservice_gnss", 45 "$LOCATION_LOCATOR_ROOT:lbsservice_locator", 46 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", 47 "$LOCATION_ROOT_DIR/frameworks/native:locator_sdk", 48 "$LOCATION_ROOT_DIR/test/location_locator:LocatorServiceAbilityTest", 49 "$SAMGR_ROOT_DIR/safwk/interfaces/innerkits/safwk:system_ability_fwk", 50 "$SAMGR_ROOT_DIR/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 51 "$SECURITY_ROOT_DIR/access_token/interfaces/innerkits/nativetoken:libnativetoken", 52 "$SECURITY_ROOT_DIR/access_token/interfaces/innerkits/token_setproc:libtoken_setproc", 53 "$START_UP_ROOT_DIR/init/interfaces/innerkits:libbegetutil", 54 ] 55 56 external_deps = [ 57 "ability_base:want", 58 "access_token:libaccesstoken_sdk", 59 "c_utils:utils", 60 "cellular_data:tel_cellular_data_api", 61 "common_event_service:cesfwk_innerkits", 62 "core_service:tel_core_service_api", 63 "drivers_interface_location_agnss:liblocation_agnss_proxy_1.0", 64 "drivers_interface_location_gnss:liblocation_gnss_proxy_1.0", 65 "eventhandler:libeventhandler", 66 "hdf_core:libhdi", 67 "hdf_core:libpub_utils", 68 "hilog:libhilog", 69 "hisysevent:libhisysevent", 70 ] 71 72 defines = [] 73 if (location_feature_with_gnss) { 74 defines += [ "FEATURE_GNSS_SUPPORT" ] 75 } 76 77 if (hdf_drivers_interface_location_agnss_enable) { 78 defines += [ "HDF_DRIVERS_INTERFACE_AGNSS_ENABLE" ] 79 } 80 81 module_out_path = module_output_path 82 } 83} else { 84 ohos_unittest("GnssAbilityTest") { 85 module_out_path = module_output_path 86 } 87} 88 89group("unittest") { 90 testonly = true 91 deps = [] 92 93 deps += [ ":GnssAbilityTest" ] 94} 95