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/service" 18if (location_feature_with_geocode) { 19 ohos_unittest("GeocodeServiceAbilityTest") { 20 module_out_path = module_output_path 21 sources = [ "$LOCATION_ROOT_DIR/test/location_geocode/source/geo_convert_service_test.cpp" ] 22 23 include_dirs = [ 24 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 25 "$LOCATION_ROOT_DIR/test/location_geocode/include", 26 "$LOCATION_ROOT_DIR/test/location_geocode/mock/include", 27 "$LOCATION_GEOCONVERT_ROOT/include", 28 "$LOCATION_LOCATOR_ROOT/include", 29 ] 30 31 deps = [ 32 "$ARKUI_ROOT_DIR/napi:ace_napi", 33 "$GOOGLE_TEST_DIR:gmock_main", 34 "$GOOGLE_TEST_DIR:gtest_main", 35 "$IPC_ROOT_DIR/interfaces/innerkits/ipc_core:ipc_core", 36 "$LOCATION_GEOCONVERT_ROOT:lbsservice_geocode_static", 37 "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static", 38 "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static", 39 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static", 40 "$SAMGR_ROOT_DIR/safwk/interfaces/innerkits/safwk:system_ability_fwk", 41 "$SAMGR_ROOT_DIR/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 42 "$START_UP_ROOT_DIR/init/interfaces/innerkits:libbegetutil", 43 ] 44 45 sanitize = { 46 cfi = true 47 cfi_cross_dso = true 48 debug = false 49 blocklist = "./../../cfi_blocklist.txt" 50 } 51 branch_protector_ret = "pac_ret" 52 53 external_deps = [ 54 "access_token:libaccesstoken_sdk", 55 "access_token:libnativetoken", 56 "access_token:libtoken_setproc", 57 "c_utils:utils", 58 "common_event_service:cesfwk_innerkits", 59 "ffrt:libffrt", 60 "hilog:libhilog", 61 "hisysevent:libhisysevent", 62 "init:libbegetutil", 63 "ipc:ipc_core", 64 "safwk:system_ability_fwk", 65 "samgr:samgr_proxy", 66 ] 67 68 defines = [] 69 if (location_feature_with_geocode) { 70 defines += [ "FEATURE_GEOCODE_SUPPORT" ] 71 } 72 73 module_out_path = module_output_path 74 } 75} else { 76 ohos_unittest("GeocodeServiceAbilityTest") { 77 module_out_path = module_output_path 78 } 79} 80 81group("unittest") { 82 testonly = true 83 deps = [] 84 deps += [ ":GeocodeServiceAbilityTest" ] 85} 86