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