1# Copyright (c) 2022-2024 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/ability_runtime/appmgrservice" 18 19ohos_unittest("AppMgrServiceInnerTest") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 blocklist = "../../cfi_blocklist.txt" 25 } 26 module_out_path = module_output_path 27 28 include_dirs = [ 29 "${ability_runtime_test_path}/mock/common/include", 30 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 31 "${ability_runtime_test_path}/mock/mock_sa_call", 32 "${ability_runtime_test_path}/mock/services_appmgr_test/include", 33 "${ability_runtime_test_path}/mock/task_handler_wrap_mock/include", 34 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 35 "${ability_runtime_services_path}/abilitymgr/include/utils", 36 "${ability_runtime_services_path}/abilitymgr/include", 37 38 "${ability_runtime_test_path}/moduletest/mock/include", 39 ] 40 41 sources = [ 42 "${ability_runtime_test_path}/mock/common/src/mock_native_token.cpp", 43 "${ability_runtime_test_path}/mock/task_handler_wrap_mock/src/mock_task_handler_wrap.cpp", 44 "app_mgr_service_inner_test.cpp", 45 ] 46 47 configs = [ "${ability_runtime_services_path}/appmgr:appmgr_config" ] 48 49 deps = [ 50 "${ability_runtime_path}/utils/server/startup:startup_util", 51 "${ability_runtime_services_path}/appmgr:libappms", 52 "${ability_runtime_services_path}/common:perm_verification", 53 "${ability_runtime_services_path}/common:task_handler_wrap", 54 ] 55 56 external_deps = [ 57 "ability_base:configuration", 58 "ability_base:want", 59 "ability_runtime:app_manager", 60 "access_token:libaccesstoken_sdk", 61 "access_token:libnativetoken", 62 "access_token:libtoken_setproc", 63 "appspawn:appspawn_client", 64 "bundle_framework:appexecfwk_base", 65 "bundle_framework:appexecfwk_core", 66 "cJSON:cjson", 67 "c_utils:utils", 68 "eventhandler:libeventhandler", 69 "ffrt:libffrt", 70 "googletest:gmock_main", 71 "googletest:gtest_main", 72 "hilog:libhilog", 73 "hisysevent:libhisysevent", 74 "hitrace:hitrace_meter", 75 "image_framework:image_native", 76 "init:libbeget_proxy", 77 "init:libbegetutil", 78 "ipc:ipc_core", 79 "jsoncpp:jsoncpp", 80 "kv_store:distributeddata_mgr", 81 "safwk:system_ability_fwk", 82 "samgr:samgr_proxy", 83 "selinux_adapter:librestorecon", 84 ] 85 defines = [] 86 if (ability_runtime_child_process) { 87 defines += [ "SUPPORT_CHILD_PROCESS" ] 88 } 89 if (ability_runtime_graphics) { 90 external_deps += [ "window_manager:libwm" ] 91 defines += [ 92 "SUPPORT_SCREEN", 93 "SUPPORT_GRAPHICS", 94 ] 95 } 96 97 if (background_task_mgr_continuous_task_enable) { 98 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 99 } 100 101 if (ability_runtime_feature_sandboxmanager) { 102 external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 103 defines += [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 104 } 105 cflags_cc = [] 106 if (os_dlp_part_enabled) { 107 cflags_cc += [ "-DWITH_DLP" ] 108 } 109} 110 111group("unittest") { 112 testonly = true 113 114 deps = [ ":AppMgrServiceInnerTest" ] 115} 116