1# Copyright (c) 2023 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("../../../../../os_account.gni") 16 17module_output_path = "os_account/os_account" 18 19config("app_account_service_config_mock") { 20 include_dirs = [ 21 "${app_account_services_path}/test/mock/app_account", 22 "${app_account_services_path}/test/mock/common", 23 "${app_account_innerkits_native_path}/include", 24 ] 25} 26 27config("app_account_service_config_unittest") { 28 visibility = [ ":*" ] 29 30 include_dirs = [] 31 32 cflags = [] 33 if (target_cpu == "arm") { 34 cflags += [ "-DBINDER_IPC_32BIT" ] 35 } 36 37 defines = [ 38 "ACCOUNT_LOG_TAG = \"AccountCommonMTest\"", 39 "LOG_DOMAIN = 0xD001B00", 40 ] 41} 42 43ohos_moduletest("account_permission_manager_module_test") { 44 branch_protector_ret = "pac_ret" 45 46 sanitize = { 47 cfi = true 48 cfi_cross_dso = true 49 debug = false 50 } 51 52 module_out_path = module_output_path 53 54 sources = [ "account_permission_manager_module_test.cpp" ] 55 56 deps = [ "${common_path}:libaccount_common" ] 57 58 external_deps = [ 59 "access_token:libaccesstoken_sdk", 60 "access_token:libtokensetproc_shared", 61 "c_utils:utils", 62 "googletest:gmock_main", 63 "googletest:gtest_main", 64 "hilog:libhilog", 65 "ipc:ipc_single", 66 ] 67 68 defines = [ 69 "ACCOUNT_LOG_TAG = \"AppAccountMTest\"", 70 "LOG_DOMAIN = 0xD001B00", 71 ] 72} 73 74ohos_moduletest("bundle_manager_adapter_module_test") { 75 branch_protector_ret = "pac_ret" 76 77 sanitize = { 78 cfi = true 79 cfi_cross_dso = true 80 debug = false 81 } 82 83 module_out_path = module_output_path 84 include_dirs = 85 [ "${services_path}/accountmgr/include/bundle_manager_adapter" ] 86 sources = [ 87 "${services_path}/accountmgr/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp", 88 "bundle_manager_adapter_module_test.cpp", 89 ] 90 91 configs = [ ":app_account_service_config_unittest" ] 92 93 deps = [ 94 "${app_account_services_path}:accountmgr", 95 "${common_path}:libaccount_common", 96 "${innerkits_native_path}:libaccountkits", 97 ] 98 99 external_deps = [ 100 "ability_base:want", 101 "ability_runtime:app_manager", 102 "ability_runtime:wantagent_innerkits", 103 "bundle_framework:appexecfwk_base", 104 "bundle_framework:appexecfwk_core", 105 "cJSON:cjson", 106 "c_utils:utils", 107 "googletest:gmock_main", 108 "googletest:gtest_main", 109 "hilog:libhilog", 110 "ipc:ipc_single", 111 "safwk:system_ability_fwk", 112 "samgr:samgr_proxy", 113 ] 114} 115 116group("moduletest") { 117 testonly = true 118 119 deps = [ 120 ":account_permission_manager_module_test", 121 ":bundle_manager_adapter_module_test", 122 ] 123} 124