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("//build/test.gni") 15import("//foundation/ability/ability_runtime/ability_runtime.gni") 16 17module_output_path = "ability_runtime/abilitymgr" 18 19config("abilityms_exception_config") { 20 cflags_cc = [ "-fexceptions" ] 21} 22 23ohos_unittest("ability_manager_service_test") { 24 module_out_path = module_output_path 25 cflags_cc = [] 26 include_dirs = [ 27 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/system_ability_mock", 28 "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include", 29 "${distributedschedule_path}/samgr/adapter/interfaces/innerkits/include/", 30 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 31 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 32 "//foundation/resourceschedule/background_task_mgr/services/transient_task/include", 33 "//foundation/arkui/ace_engine/frameworks", 34 "//foundation/resourceschedule/resource_schedule_service/ressched/interfaces/innerkits/ressched_client/include", 35 "mock/include", 36 ] 37 38 sources = [ 39 # add mock file 40 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/appexecfwk_core/src/appmgr/mock_app_scheduler.cpp", 41 "ability_manager_service_test.cpp", 42 "mock/src/mock_my_flag.cpp", 43 "mock/src/mock_permission_verification.cpp", 44 ] 45 46 configs = [ 47 "${ability_runtime_services_path}/abilitymgr:abilityms_config", 48 "${ability_runtime_services_path}/abilitymgr:abilityms_exception_config", 49 ] 50 51 cflags = [] 52 if (target_cpu == "arm") { 53 cflags += [ "-DBINDER_IPC_32BIT" ] 54 } 55 deps = [ 56 "${ability_runtime_innerkits_path}/app_manager:app_manager", 57 "${ability_runtime_innerkits_path}/connectionobs_manager:connection_obs_manager", 58 "${ability_runtime_native_path}/ability/native:abilitykit_native", 59 "${ability_runtime_services_path}/abilitymgr:abilityms", 60 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit:aakit_mock", 61 "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/appexecfwk_core:appexecfwk_appmgr_mock", 62 "${ability_runtime_test_path}/unittest:abilityms_test_source", 63 "//third_party/googletest:gmock_main", 64 "//third_party/googletest:gtest_main", 65 ] 66 67 external_deps = [ 68 "ability_base:configuration", 69 "ability_base:want", 70 "ability_base:zuri", 71 "ability_runtime:ability_deps_wrapper", 72 "ability_runtime:ability_manager", 73 "ability_runtime:abilitykit_native", 74 "ability_runtime:app_manager", 75 "ability_runtime:connection_obs_manager", 76 "access_token:libaccesstoken_sdk", 77 "bundle_framework:appexecfwk_base", 78 "c_utils:utils", 79 "common_event_service:cesfwk_core", 80 "common_event_service:cesfwk_innerkits", 81 "dsoftbus:softbus_client", 82 "eventhandler:libeventhandler", 83 "hicollie_native:libhicollie", 84 "hisysevent_native:libhisysevent", 85 "hitrace_native:hitrace_meter", 86 "hiviewdfx_hilog_native:libhilog", 87 "init:libbeget_proxy", 88 "init:libbegetutil", 89 "ipc:ipc_core", 90 "relational_store:native_dataability", 91 "relational_store:native_rdb", 92 "safwk:system_ability_fwk", 93 "samgr:samgr_proxy", 94 ] 95 96 if (background_task_mgr_continuous_task_enable) { 97 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 98 } 99} 100 101group("unittest") { 102 testonly = true 103 deps = [ ":ability_manager_service_test" ] 104} 105