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_sys_manager_test.cpp", 31 "./edm_utils_test.cpp", 32 "./external/edm_access_token_manager_impl_test.cpp", 33 "./external/edm_app_manager_impl_test.cpp", 34 "./external/edm_bundle_manager_impl_test.cpp", 35 "./external/edm_os_account_manager_impl_test.cpp", 36 "./external/external_manager_factory_test.cpp", 37 "./usb_device_id_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 "cJSON:cjson", 62 "c_utils:utils", 63 "hilog:libhilog", 64 "init:libbegetutil", 65 "ipc:ipc_core", 66 "relational_store:native_rdb", 67 "safwk:system_ability_fwk", 68 "samgr:samgr_proxy", 69 ] 70 71 defines = [] 72 if (os_account_edm_enable) { 73 external_deps += [ 74 "os_account:libaccountkits", 75 "os_account:os_account_innerkits", 76 ] 77 defines += [ "OS_ACCOUNT_EDM_ENABLE" ] 78 } 79 80 sanitize = { 81 boundary_sanitize = true 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 integer_overflow = true 86 ubsan = true 87 blocklist = "../cfi_blocklist.txt" 88 } 89 branch_protector_ret = "pac_ret" 90 subsystem_name = "customization" 91 part_name = "enterprise_device_management" 92} 93 94group("unittest") { 95 testonly = true 96 97 deps = [ 98 # deps file 99 ":EdmCommonUnitTest", 100 ] 101} 102