• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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/ohos.gni")
15import("//build/ohos_var.gni")
16import("//build/test.gni")
17import("//foundation/deviceprofile/device_info_manager/deviceprofile.gni")
18
19module_output_path = "device_info_manager/deviceprofiletest"
20
21device_profile_configs = [
22  "${device_profile_service}/core:device_info_manager_config",
23  "${device_profile_test}/resource:coverage_flags",
24]
25
26device_profile_deps = [
27  "${device_profile_innerkits}/core:distributed_device_profile_client",
28  "${device_profile_service}/core:distributed_device_profile",
29  "//third_party/googletest:gtest_main",
30]
31
32device_profile_external_deps = [
33  "ability_base:want",
34  "access_token:libaccesstoken_sdk",
35  "access_token:libnativetoken",
36  "access_token:libtoken_setproc",
37  "c_utils:utils",
38  "device_auth:deviceauth_sdk",
39  "device_manager:devicemanagersdk",
40  "dsoftbus:softbus_client",
41  "eventhandler:libeventhandler",
42  "hilog:libhilog",
43  "hisysevent:libhisysevent",
44  "ipc:ipc_core",
45  "kv_store:distributeddata_inner",
46  "safwk:system_ability_fwk",
47  "syscap_codec:syscap_interface_shared",
48]
49
50ohos_unittest("profile_crud_test") {
51  module_out_path = module_output_path
52
53  sources = [
54    "unittest/profile_crud_test.cpp",
55    "unittest/test_util.cpp",
56  ]
57  configs = device_profile_configs
58  deps = device_profile_deps
59  external_deps = device_profile_external_deps
60  part_name = "device_info_manager"
61  subsystem_name = "deviceprofile"
62}
63
64ohos_unittest("profile_dm_test") {
65  module_out_path = module_output_path
66
67  sources = [ "unittest/profile_dm_test.cpp" ]
68  configs = device_profile_configs
69  deps = device_profile_deps
70  external_deps = device_profile_external_deps
71  part_name = "device_info_manager"
72  subsystem_name = "deviceprofile"
73}
74
75ohos_unittest("profile_storage_test") {
76  module_out_path = module_output_path
77
78  sources = [ "unittest/profile_storage_test.cpp" ]
79  configs = device_profile_configs
80  deps = device_profile_deps
81  external_deps = device_profile_external_deps
82  part_name = "device_info_manager"
83  subsystem_name = "deviceprofile"
84}
85
86ohos_unittest("profile_sync_test") {
87  module_out_path = module_output_path
88
89  sources = [ "unittest/profile_sync_test.cpp" ]
90  configs = device_profile_configs
91  deps = device_profile_deps
92  external_deps = device_profile_external_deps
93  part_name = "device_info_manager"
94  subsystem_name = "deviceprofile"
95}
96
97ohos_unittest("event_subscribe_test") {
98  module_out_path = module_output_path
99
100  sources = [ "unittest/event_subscribe_test.cpp" ]
101  configs = device_profile_configs
102  deps = device_profile_deps
103  external_deps = device_profile_external_deps
104  part_name = "device_info_manager"
105  subsystem_name = "deviceprofile"
106}
107
108ohos_unittest("profile_authority_test") {
109  module_out_path = module_output_path
110
111  sources = [
112    "unittest/profile_authority_test.cpp",
113    "unittest/test_util.cpp",
114  ]
115  configs = device_profile_configs
116  deps = device_profile_deps
117  external_deps = device_profile_external_deps
118  part_name = "device_info_manager"
119  subsystem_name = "deviceprofile"
120}
121
122ohos_unittest("content_sensor_test") {
123  module_out_path = module_output_path
124
125  sources = [ "unittest/content_sensor_test.cpp" ]
126  configs = device_profile_configs
127  deps = device_profile_deps
128  external_deps = device_profile_external_deps
129  part_name = "device_info_manager"
130  subsystem_name = "deviceprofile"
131}
132
133ohos_unittest("profile_change_notification_test") {
134  module_out_path = module_output_path
135
136  sources = [ "unittest/profile_change_notification_test.cpp" ]
137  configs = device_profile_configs
138  deps = device_profile_deps
139  external_deps = device_profile_external_deps
140  part_name = "device_info_manager"
141  subsystem_name = "deviceprofile"
142}
143
144ohos_unittest("profile_entry_test") {
145  module_out_path = module_output_path
146
147  sources = [ "unittest/profile_entry_test.cpp" ]
148  configs = device_profile_configs
149  deps = device_profile_deps
150  external_deps = device_profile_external_deps
151  part_name = "device_info_manager"
152  subsystem_name = "deviceprofile"
153}
154
155ohos_unittest("profile_proxy_test") {
156  module_out_path = module_output_path
157
158  sources = [ "unittest/profile_proxy_test.cpp" ]
159  configs = device_profile_configs
160  deps = device_profile_deps
161  external_deps = device_profile_external_deps
162  part_name = "device_info_manager"
163  subsystem_name = "deviceprofile"
164}
165
166ohos_unittest("service_profile_test") {
167  module_out_path = module_output_path
168
169  sources = [ "unittest/service_profile_test.cpp" ]
170  configs = device_profile_configs
171  deps = device_profile_deps
172  external_deps = device_profile_external_deps
173  part_name = "device_info_manager"
174  subsystem_name = "deviceprofile"
175}
176
177ohos_unittest("subscribe_info_test") {
178  module_out_path = module_output_path
179
180  sources = [ "unittest/subscribe_info_test.cpp" ]
181  configs = device_profile_configs
182  deps = device_profile_deps
183  external_deps = device_profile_external_deps
184  part_name = "device_info_manager"
185  subsystem_name = "deviceprofile"
186}
187
188ohos_unittest("subscribe_manager_test") {
189  module_out_path = module_output_path
190
191  sources = [ "unittest/subscribe_manager_test.cpp" ]
192  configs = device_profile_configs
193  deps = device_profile_deps
194  external_deps = device_profile_external_deps
195  part_name = "device_info_manager"
196  subsystem_name = "deviceprofile"
197}
198
199ohos_unittest("profile_change_handler_test") {
200  module_out_path = module_output_path
201
202  sources = [ "unittest/profile_change_handler_test.cpp" ]
203  configs = device_profile_configs
204  deps = device_profile_deps
205  external_deps = device_profile_external_deps
206  part_name = "device_info_manager"
207  subsystem_name = "deviceprofile"
208}
209
210ohos_unittest("subscribe_info_checker_test") {
211  module_out_path = module_output_path
212
213  sources = [ "unittest/subscribe_info_checker_test.cpp" ]
214  configs = device_profile_configs
215  deps = device_profile_deps
216  external_deps = device_profile_external_deps
217  part_name = "device_info_manager"
218  subsystem_name = "deviceprofile"
219}
220
221ohos_unittest("device_profile_dfx_test") {
222  module_out_path = module_output_path
223
224  sources = [ "unittest/device_profile_dfx_test.cpp" ]
225  configs = device_profile_configs
226  deps = device_profile_deps
227  external_deps = device_profile_external_deps
228  part_name = "device_info_manager"
229  subsystem_name = "deviceprofile"
230}
231
232ohos_unittest("device_profile_utils_test") {
233  module_out_path = module_output_path
234
235  sources = [ "unittest/device_profile_utils_test.cpp" ]
236  configs = device_profile_configs
237  deps = device_profile_deps
238  external_deps = device_profile_external_deps
239  part_name = "device_info_manager"
240  subsystem_name = "deviceprofile"
241}
242
243ohos_unittest("profile_event_notifier_proxy_test") {
244  module_out_path = module_output_path
245
246  sources = [ "unittest/profile_event_notifier_proxy_test.cpp" ]
247  configs = device_profile_configs
248  deps = device_profile_deps
249  external_deps = device_profile_external_deps
250  part_name = "device_info_manager"
251  subsystem_name = "deviceprofile"
252}
253
254group("unittest") {
255  testonly = true
256  deps = [
257    ":content_sensor_test",
258    ":device_profile_dfx_test",
259    ":device_profile_utils_test",
260    ":event_subscribe_test",
261    ":profile_authority_test",
262    ":profile_change_handler_test",
263    ":profile_change_notification_test",
264    ":profile_crud_test",
265    ":profile_dm_test",
266    ":profile_entry_test",
267    ":profile_event_notifier_proxy_test",
268    ":profile_proxy_test",
269    ":profile_storage_test",
270    ":profile_sync_test",
271    ":service_profile_test",
272    ":subscribe_info_checker_test",
273    ":subscribe_info_test",
274    ":subscribe_manager_test",
275  ]
276}
277