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