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/common" 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:locator_sdk_static", 44 "$LOCATION_ROOT_DIR/services/location_locator/locator:lbsservice_locator_static", 45 ] 46 47 external_deps = [ 48 "ability_base:want", 49 "ability_runtime:dataobs_manager", 50 "ability_runtime:wantagent_innerkits", 51 "access_token:libaccesstoken_sdk", 52 "access_token:libnativetoken", 53 "access_token:libtoken_setproc", 54 "access_token:libtokenid_sdk", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "data_share:datashare_common", 60 "data_share:datashare_consumer", 61 "hilog:libhilog", 62 "hisysevent:libhisysevent", 63 "init:libbegetutil", 64 "ipc:ipc_core", 65 "location:locator_sdk", 66 "os_account:os_account_innerkits", 67 "relational_store:native_dataability", 68 "relational_store:native_rdb", 69 "samgr:samgr_proxy", 70 ] 71 72 defines = [] 73 if (location_feature_with_geocode) { 74 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 75 } 76 77 if (location_feature_with_gnss) { 78 defines += [ "FEATURE_GNSS_SUPPORT" ] 79 } 80 81 module_out_path = module_output_path 82} 83 84group("unittest") { 85 testonly = true 86 deps = [] 87 deps += [ ":LocationCommonTest" ] 88} 89