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("../../../common/config/common.gni") 16 17module_output_path = "enterprise_device_management/enterprise_device_management" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21} 22 23ohos_unittest("EdmCommonUnitTest") { 24 module_out_path = module_output_path 25 26 include_dirs = [ "../../../services/edm/include" ] 27 28 sources = [ 29 "./bundle_manager_utils_test.cpp", 30 "./edm_permission_test.cpp", 31 "./edm_sys_manager_test.cpp", 32 "./edm_utils_test.cpp", 33 "./external/edm_access_token_manager_impl_test.cpp", 34 "./external/edm_app_manager_impl_test.cpp", 35 "./external/edm_bundle_manager_impl_test.cpp", 36 "./external/edm_os_account_manager_impl_test.cpp", 37 "./external/external_manager_factory_test.cpp", 38 ] 39 40 configs = [ 41 ":module_private_config", 42 "../../../common/config:coverage_flags", 43 ] 44 45 deps = [ 46 "../../../common/external:edm_external_adapters", 47 "../../../common/native:edm_commom", 48 "../../../interfaces/inner_api:edmservice_kits", 49 "../../../interfaces/inner_api/plugin_kits:plugin_kits", 50 "../../../services/edm:edmservice", 51 "../utils:edm_unittest_utils", 52 ] 53 54 external_deps = [ 55 "ability_runtime:app_manager", 56 "access_token:libaccesstoken_sdk", 57 "access_token:libnativetoken", 58 "access_token:libtoken_setproc", 59 "bundle_framework:appexecfwk_base", 60 "bundle_framework:appexecfwk_core", 61 "c_utils:utils", 62 "init:libbegetutil", 63 "ipc:ipc_core", 64 "relational_store:native_rdb", 65 "safwk:system_ability_fwk", 66 "samgr:samgr_proxy", 67 ] 68 69 defines = [] 70 if (os_account_edm_enable) { 71 external_deps += [ 72 "os_account:libaccountkits", 73 "os_account:os_account_innerkits", 74 ] 75 defines += [ "OS_ACCOUNT_EDM_ENABLE" ] 76 } 77 78 sanitize = { 79 boundary_sanitize = true 80 cfi = true 81 cfi_cross_dso = true 82 debug = false 83 integer_overflow = true 84 ubsan = true 85 blocklist = "../cfi_blocklist.txt" 86 } 87 branch_protector_ret = "pac_ret" 88 subsystem_name = "customization" 89 part_name = "enterprise_device_management" 90} 91 92group("unittest") { 93 testonly = true 94 95 deps = [ 96 # deps file 97 ":EdmCommonUnitTest", 98 ] 99} 100