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  ]
38
39  configs = [
40    ":module_private_config",
41    "../../../common/config:coverage_flags",
42  ]
43
44  deps = [
45    "../../../common/external:edm_external_adapters",
46    "../../../common/native:edm_commom",
47    "../../../interfaces/inner_api:edmservice_kits",
48    "../../../interfaces/inner_api/plugin_kits:plugin_kits",
49    "../../../services/edm:edmservice",
50    "../utils:edm_unittest_utils",
51  ]
52
53  external_deps = [
54    "ability_runtime:app_manager",
55    "access_token:libaccesstoken_sdk",
56    "access_token:libnativetoken",
57    "access_token:libtoken_setproc",
58    "bundle_framework:appexecfwk_base",
59    "bundle_framework:appexecfwk_core",
60    "c_utils:utils",
61    "init:libbegetutil",
62    "ipc:ipc_core",
63    "relational_store:native_rdb",
64    "safwk:system_ability_fwk",
65    "samgr:samgr_proxy",
66  ]
67
68  defines = []
69  if (os_account_edm_enable) {
70    external_deps += [
71      "os_account:libaccountkits",
72      "os_account:os_account_innerkits",
73    ]
74    defines += [ "OS_ACCOUNT_EDM_ENABLE" ]
75  }
76
77  sanitize = {
78    boundary_sanitize = true
79    cfi = true
80    cfi_cross_dso = true
81    debug = false
82    integer_overflow = true
83    ubsan = true
84    blocklist = "../cfi_blocklist.txt"
85  }
86  branch_protector_ret = "pac_ret"
87  subsystem_name = "customization"
88  part_name = "enterprise_device_management"
89}
90
91group("unittest") {
92  testonly = true
93
94  deps = [
95    # deps file
96    ":EdmCommonUnitTest",
97  ]
98}
99