• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//base/customization/enterprise_device_management/edm.gni")
15import("//build/test.gni")
16
17module_output_path = "enterprise_device_management/services"
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21  include_dirs = [ "$SUBSYSTEM_DIR/test" ]
22}
23
24ohos_unittest("EdmServicesUnitTest") {
25  module_out_path = module_output_path
26
27  include_dirs = [
28    "//commonlibrary/c_utils/base/include",
29    "//utils/system/safwk/native/include",
30    "$EDM_SA_ROOT/include",
31    "$EDM_SA_ROOT/include/utils",
32    "//commonlibrary/c_utils/base:utils_config",
33    JSONCPP_INCLUDE_DIR,
34    "./include",
35    "$SUBSYSTEM_DIR/interfaces/inner_api/include",
36    "$SUBSYSTEM_DIR/common/native/include",
37  ]
38
39  sources = [
40    "./src/admin_manager_test.cpp",
41    "./src/cmd_utils.cpp",
42    "./src/datetime_manager_proxy_test.cpp",
43    "./src/edm_permission_test.cpp",
44    "./src/edm_sys_manager_test.cpp",
45    "./src/ent_info_test.cpp",
46    "./src/enterprise_admin_connection_test.cpp",
47    "./src/enterprise_bundle_connection_test.cpp",
48    "./src/enterprise_conn_manager_test.cpp",
49    "./src/enterprise_device_mgr_ability_test.cpp",
50    "./src/enterprise_device_mgr_proxy_test.cpp",
51    "./src/iplugin_template_test.cpp",
52    "./src/iplugin_test.cpp",
53    "./src/permission_manager_test.cpp",
54    "./src/plugin_manager_test.cpp",
55    "./src/policy_manager_test.cpp",
56    "./src/policy_serializer_test.cpp",
57    "./src/utils_test.cpp",
58  ]
59
60  configs = [
61    ":module_private_config",
62    "//base/customization/enterprise_device_management/common/config:coverage_flags",
63  ]
64
65  deps = [
66    "$EDM_INNERKITS_PATH:edmservice_kits",
67    "$EDM_SA_ROOT:edmservice",
68    "//third_party/googletest:gmock_main",
69    "//third_party/googletest:gtest_main",
70    "//third_party/jsoncpp:jsoncpp",
71  ]
72
73  external_deps = [
74    "ability_base:want",
75    "ability_runtime:ability_manager",
76    "access_token:libaccesstoken_sdk",
77    "access_token:libnativetoken",
78    "access_token:libtoken_setproc",
79    "bundle_framework:appexecfwk_base",
80    "bundle_framework:appexecfwk_core",
81    "c_utils:utils",
82    "common_event_service:cesfwk_innerkits",
83    "ipc:ipc_core",
84    "safwk:system_ability_fwk",
85    "samgr:samgr_proxy",
86  ]
87
88  if (is_standard_system) {
89    external_deps += [ "hiviewdfx_hilog_native:libhilog" ]
90  } else {
91    external_deps += [ "hilog:libhilog" ]
92  }
93
94  subsystem_name = "customization"
95  part_name = "enterprise_device_management"
96}
97
98group("unittest") {
99  testonly = true
100  deps = []
101
102  deps += [
103    # deps file
104    ":EdmServicesUnitTest",
105    "enterprise_device_mgr_ability:unittest",
106    "enterprise_device_mgr_proxy:unittest",
107  ]
108}
109