# Copyright (C) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/location/config.gni") import("//build/test.gni") module_output_path = "location/service" if (location_feature_with_network) { NETWORK_UNIT_TEST_DIR = "$LOCATION_ROOT_DIR/test/location_network" ohos_unittest("NetworkAbilityTest") { module_out_path = module_output_path sources = [ "$LOCATION_ROOT_DIR/test/mock/src/mock_service_registry.cpp", "$NETWORK_UNIT_TEST_DIR/source/network_ability_stub_test.cpp", "$NETWORK_UNIT_TEST_DIR/source/network_ability_test.cpp", ] include_dirs = [ "$LOCATION_ROOT_DIR/interfaces/inner_api/include", "$NETWORK_UNIT_TEST_DIR/include", "$NETWORK_UNIT_TEST_DIR/mock/include", "$LOCATION_LOCATOR_ROOT/include", "$LOCATION_NETWORK_ROOT/include", ] sanitize = { cfi = true cfi_cross_dso = true debug = false blocklist = "./../../cfi_blocklist.txt" } branch_protector_ret = "pac_ret" deps = [ "$ARKUI_ROOT_DIR/napi:ace_napi", "$GOOGLE_TEST_DIR:gmock_main", "$GOOGLE_TEST_DIR:gtest_main", "$IPC_ROOT_DIR/interfaces/innerkits/ipc_core:ipc_core", "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static", "$LOCATION_NETWORK_ROOT:lbsservice_network_static", "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static", "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static", "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk_static", "$SAMGR_ROOT_DIR/safwk/interfaces/innerkits/safwk:system_ability_fwk", "$SAMGR_ROOT_DIR/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", "$START_UP_ROOT_DIR/init/interfaces/innerkits:libbegetutil", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", ] defines = [] if (location_feature_with_network) { defines += [ "FEATURE_NETWORK_SUPPORT" ] } module_out_path = module_output_path } } else { ohos_unittest("NetworkAbilityTest") { module_out_path = module_output_path } } group("unittest") { testonly = true deps = [] deps += [ ":NetworkAbilityTest" ] }