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 14import("//base/location/config.gni") 15import("//build/test.gni") 16 17module_output_path = "location/location" 18 19ohos_unittest("LocationCommonTest") { 20 module_out_path = module_output_path 21 sources = [ 22 "$LOCATION_ROOT_DIR/test/location_common/source/common_utils_test.cpp", 23 "$LOCATION_ROOT_DIR/test/location_common/source/location_common_test.cpp", 24 ] 25 26 include_dirs = [ 27 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 28 "$LOCATION_ROOT_DIR/services/location_locator/locator/include", 29 "$LOCATION_ROOT_DIR/test/location_common/include", 30 ] 31 32 sanitize = { 33 cfi = true 34 cfi_cross_dso = true 35 debug = false 36 blocklist = "./../../cfi_blocklist.txt" 37 } 38 branch_protector_ret = "pac_ret" 39 40 deps = [ 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/locator_sdk:liblocator_interface_proxy", 44 "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:liblocator_interface_stub", 45 "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static", 46 "$LOCATION_ROOT_DIR/services/location_locator/locator:lbsservice_locator_static", 47 ] 48 49 external_deps = [ 50 "ability_base:want", 51 "ability_runtime:dataobs_manager", 52 "ability_runtime:wantagent_innerkits", 53 "access_token:libaccesstoken_sdk", 54 "access_token:libnativetoken", 55 "access_token:libtoken_setproc", 56 "access_token:libtokenid_sdk", 57 "bundle_framework:appexecfwk_base", 58 "bundle_framework:appexecfwk_core", 59 "c_utils:utils", 60 "common_event_service:cesfwk_innerkits", 61 "data_share:datashare_common", 62 "data_share:datashare_consumer", 63 "hilog:libhilog", 64 "hisysevent:libhisysevent", 65 "init:libbegetutil", 66 "ipc:ipc_core", 67 "location:locator_sdk", 68 "os_account:os_account_innerkits", 69 "relational_store:native_dataability", 70 "relational_store:native_rdb", 71 "samgr:samgr_proxy", 72 "selinux_adapter:librestorecon", 73 ] 74 75 defines = [] 76 if (location_feature_with_geocode) { 77 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 78 } 79 80 if (location_feature_with_gnss) { 81 defines += [ "FEATURE_GNSS_SUPPORT" ] 82 } 83 84 module_out_path = module_output_path 85} 86 87group("unittest") { 88 testonly = true 89 deps = [] 90 deps += [ ":LocationCommonTest" ] 91} 92