• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-2025 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(
16    "//foundation/distributedhardware/distributed_hardware_fwk/distributedhardwarefwk.gni")
17
18module_out_path = "distributed_hardware_fwk/resource_manager_test"
19
20config("module_private_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "include",
24    "${utils_path}/include",
25    "${utils_path}/include/log",
26    "${utils_path}/include/eventbus",
27    "${services_path}/distributedhardwarefwkservice/include",
28    "${services_path}/distributedhardwarefwkservice/include/resourcemanager",
29    "${services_path}/distributedhardwarefwkservice/include/task",
30    "${services_path}/distributedhardwarefwkservice/include/utils",
31    "${common_path}/utils/include",
32    "${common_path}/log/include",
33  ]
34}
35
36## UnitTest resource_manager_test
37ohos_unittest("CapabilityInfoTest") {
38  module_out_path = module_out_path
39
40  sources = [ "capability_info_test.cpp" ]
41
42  configs = [ ":module_private_config" ]
43
44  cflags = [
45    "-Wall",
46    "-Werror",
47    "-g3",
48    "-Dprivate=public",
49  ]
50
51  deps = [
52    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
53    "${utils_path}:distributedhardwareutils",
54  ]
55
56  external_deps = [
57    "cJSON:cjson",
58    "c_utils:utils",
59    "hilog:libhilog",
60    "kv_store:distributeddata_inner",
61  ]
62}
63
64ohos_unittest("DBAdapterTest") {
65  module_out_path = module_out_path
66
67  sources = [ "db_adapter_test.cpp" ]
68
69  configs = [ ":module_private_config" ]
70
71  cflags = [
72    "-Wall",
73    "-Werror",
74    "-g3",
75    "-Dprivate=public",
76  ]
77
78  deps = [
79    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
80    "${utils_path}:distributedhardwareutils",
81  ]
82
83  external_deps = [
84    "cJSON:cjson",
85    "c_utils:utils",
86    "eventhandler:libeventhandler",
87    "hilog:libhilog",
88    "ipc:ipc_core",
89    "kv_store:distributeddata_inner",
90  ]
91}
92
93ohos_unittest("LocalCapInfoMgrTest") {
94  module_out_path = module_out_path
95
96  sources = [ "local_capability_info_manager_test.cpp" ]
97
98  configs = [ ":module_private_config" ]
99
100  cflags = [
101    "-Wall",
102    "-Werror",
103    "-g3",
104    "-Dprivate=public",
105  ]
106
107  deps = [
108    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
109    "${utils_path}:distributedhardwareutils",
110  ]
111
112  external_deps = [
113    "cJSON:cjson",
114    "c_utils:utils",
115    "eventhandler:libeventhandler",
116    "hilog:libhilog",
117    "kv_store:distributeddata_inner",
118    "safwk:system_ability_fwk",
119  ]
120}
121
122ohos_unittest("MetaCapInfoTest") {
123  module_out_path = module_out_path
124
125  sources = [ "meta_cap_info_test.cpp" ]
126
127  configs = [ ":module_private_config" ]
128
129  cflags = [
130    "-Wall",
131    "-Werror",
132    "-g3",
133    "-Dprivate=public",
134  ]
135
136  deps = [
137    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
138    "${utils_path}:distributedhardwareutils",
139  ]
140
141  external_deps = [
142    "cJSON:cjson",
143    "c_utils:utils",
144    "eventhandler:libeventhandler",
145    "hilog:libhilog",
146    "kv_store:distributeddata_inner",
147  ]
148}
149
150ohos_unittest("MetaInfoMgrTest") {
151  module_out_path = module_out_path
152
153  sources = [ "meta_info_manager_test.cpp" ]
154
155  configs = [ ":module_private_config" ]
156
157  cflags = [
158    "-Wall",
159    "-Werror",
160    "-g3",
161    "-Dprivate=public",
162  ]
163
164  deps = [
165    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
166    "${utils_path}:distributedhardwareutils",
167  ]
168
169  external_deps = [
170    "cJSON:cjson",
171    "c_utils:utils",
172    "eventhandler:libeventhandler",
173    "hilog:libhilog",
174    "ipc:ipc_core",
175    "kv_store:distributeddata_inner",
176    "safwk:system_ability_fwk",
177  ]
178}
179
180ohos_unittest("ResourceManagerTest") {
181  module_out_path = module_out_path
182
183  sources = [ "resource_manager_test.cpp" ]
184
185  configs = [ ":module_private_config" ]
186
187  cflags = [
188    "-Wall",
189    "-Werror",
190    "-g3",
191    "-Dprivate=public",
192  ]
193
194  deps = [
195    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
196    "${utils_path}:distributedhardwareutils",
197  ]
198
199  external_deps = [
200    "cJSON:cjson",
201    "c_utils:utils",
202    "eventhandler:libeventhandler",
203    "hilog:libhilog",
204    "ipc:ipc_core",
205    "kv_store:distributeddata_inner",
206    "safwk:system_ability_fwk",
207  ]
208}
209
210ohos_unittest("VersionInfoTest") {
211  module_out_path = module_out_path
212
213  sources = [ "version_info_test.cpp" ]
214
215  configs = [ ":module_private_config" ]
216
217  cflags = [
218    "-Wall",
219    "-Werror",
220    "-g3",
221    "-Dprivate=public",
222  ]
223
224  deps = [
225    "${services_path}/distributedhardwarefwkservice:distributedhardwarefwksvr",
226    "${utils_path}:distributedhardwareutils",
227  ]
228
229  external_deps = [
230    "cJSON:cjson",
231    "c_utils:utils",
232    "hilog:libhilog",
233    "kv_store:distributeddata_inner",
234  ]
235}
236
237group("resource_manager_test") {
238  testonly = true
239  deps = [
240    ":CapabilityInfoTest",
241    ":DBAdapterTest",
242    ":LocalCapInfoMgrTest",
243    ":MetaCapInfoTest",
244    ":MetaInfoMgrTest",
245    ":ResourceManagerTest",
246    ":VersionInfoTest",
247  ]
248}
249