• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/powermgr/battery_manager/batterymgr.gni")
15import("//build/test.gni")
16import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "include",
24    "//drivers/peripheral/battery/charger/ui/include",
25    "//third_party/libpng",
26    "${battery_innerkits}/native/include",
27    "${battery_service_zidl}/include",
28    "//drivers/peripheral/battery/charger/led",
29    "//drivers/peripheral/battery/charger/backlight",
30    "//drivers/peripheral/battery/charger/vibrate",
31    "//drivers/peripheral/battery/charger/include",
32    "//drivers/peripheral/battery/interfaces/hdi_service/test/unittest/include",
33    "//drivers/peripheral/battery/interfaces/include/",
34    "//drivers/peripheral/battery/include/",
35    "//drivers/peripheral/battery/interfaces/hdi_service/include",
36    "//drivers/peripheral/battery/charger/led",
37    "//drivers/peripheral/battery/utils/include",
38    "//base/powermgr/power_manager/interfaces/innerkits/native/include",
39  ]
40}
41
42##############################systemtest##########################################
43ohos_systemtest("test_systemtest") {
44  module_out_path = "${module_output_path}"
45
46  sources = [
47    "//base/powermgr/battery_manager/utils/native/src/test_utils.cpp",
48    "src/battery_sttest.cpp",
49  ]
50
51  configs = [
52    "${battery_utils}:utils_config",
53    ":module_private_config",
54  ]
55
56  deps = [
57    "${battery_innerkits}:batterysrv_client",
58    "${battery_service}:batteryservice",
59    "${hdf_uhdf_path}/host:libhdf_host",
60    "${hdf_uhdf_path}/utils:libhdf_utils",
61    "//drivers/peripheral/battery/charger/ui:libminui",
62    "//third_party/googletest:gtest_main",
63    "//third_party/jsoncpp:jsoncpp",
64  ]
65
66  external_deps = [
67    "ability_base:base",
68    "ability_base:want",
69    "c_utils:utils",
70    "common_event_service:cesfwk_innerkits",
71    "drivers_interface_battery:libbattery_proxy_1.1",
72    "drivers_interface_input:hdi_input",
73    "drivers_interface_light:liblight_proxy_1.0",
74    "eventhandler:libeventhandler",
75    "hdf_core:libhdf_utils",
76    "hdf_core:libhdi",
77    "hiviewdfx_hilog_native:libhilog",
78    "init:libbegetutil",
79    "ipc:ipc_core",
80    "safwk:system_ability_fwk",
81    "samgr:samgr_proxy",
82  ]
83}
84
85##############################systemtest##########################################
86ohos_systemtest("test_reboot") {
87  module_out_path = "${module_output_path}"
88
89  sources = [
90    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
91    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
92    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
93    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
94    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
95    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
96    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
97    "src/reboot_test.cpp",
98  ]
99
100  configs = [
101    "${battery_utils}:utils_config",
102    ":module_private_config",
103  ]
104
105  deps = [
106    "${hdf_uhdf_path}/utils:libhdf_utils",
107    "//drivers/peripheral/battery/charger/ui:libminui",
108    "//third_party/googletest:gtest_main",
109    "//third_party/jsoncpp:jsoncpp",
110  ]
111
112  external_deps = [
113    "c_utils:utils",
114    "drivers_interface_battery:libbattery_proxy_1.1",
115    "drivers_interface_input:hdi_input",
116    "drivers_interface_light:liblight_proxy_1.0",
117    "hiviewdfx_hilog_native:libhilog",
118    "init:libbegetutil",
119    "ipc:ipc_core",
120  ]
121}
122
123##############################systemtest##########################################
124ohos_systemtest("test_charger_overtemperature_shutdown") {
125  module_out_path = "${module_output_path}"
126
127  sources = [
128    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
129    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
130    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
131    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
132    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
133    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
134    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
135    "src/charger_overtemperature_shutdown_test.cpp",
136  ]
137
138  configs = [
139    "${battery_utils}:utils_config",
140    ":module_private_config",
141  ]
142
143  deps = [
144    "${hdf_uhdf_path}/utils:libhdf_utils",
145    "//drivers/peripheral/battery/charger/ui:libminui",
146    "//third_party/googletest:gtest_main",
147    "//third_party/jsoncpp:jsoncpp",
148  ]
149
150  external_deps = [
151    "c_utils:utils",
152    "drivers_interface_battery:libbattery_proxy_1.1",
153    "drivers_interface_input:hdi_input",
154    "drivers_interface_light:liblight_proxy_1.0",
155    "hiviewdfx_hilog_native:libhilog",
156    "init:libbegetutil",
157    "ipc:ipc_core",
158  ]
159}
160
161##############################systemtest##########################################
162ohos_systemtest("test_charger_undertemperature_shutdown") {
163  module_out_path = "${module_output_path}"
164
165  sources = [
166    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
167    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
168    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
169    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
170    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
171    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
172    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
173    "src/charger_undertemperature_shutdown_test.cpp",
174  ]
175
176  configs = [
177    "${battery_utils}:utils_config",
178    ":module_private_config",
179  ]
180
181  deps = [
182    "${hdf_uhdf_path}/utils:libhdf_utils",
183    "//drivers/peripheral/battery/charger/ui:libminui",
184    "//third_party/googletest:gtest_main",
185    "//third_party/jsoncpp:jsoncpp",
186  ]
187
188  external_deps = [
189    "c_utils:utils",
190    "drivers_interface_battery:libbattery_proxy_1.1",
191    "drivers_interface_input:hdi_input",
192    "drivers_interface_light:liblight_proxy_1.0",
193    "hiviewdfx_hilog_native:libhilog",
194    "init:libbegetutil",
195    "ipc:ipc_core",
196  ]
197}
198
199##############################systemtest##########################################
200ohos_systemtest("test_battery_overtemperature_shutdown") {
201  module_out_path = "${module_output_path}"
202
203  sources = [
204    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
205    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
206    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
207    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
208    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
209    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
210    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
211    "src/battery_overtemperature_shutdown_test.cpp",
212  ]
213
214  configs = [
215    "${battery_utils}:utils_config",
216    ":module_private_config",
217  ]
218
219  deps = [
220    "${battery_manager_path}/interfaces/innerkits:batterysrv_client",
221    "${hdf_uhdf_path}/utils:libhdf_utils",
222    "//base/powermgr/battery_manager/services:batteryservice",
223    "//drivers/peripheral/battery/charger/ui:libminui",
224    "//third_party/googletest:gtest_main",
225    "//third_party/jsoncpp:jsoncpp",
226  ]
227
228  external_deps = [
229    "ability_base:base",
230    "ability_base:want",
231    "c_utils:utils",
232    "common_event_service:cesfwk_innerkits",
233    "drivers_interface_battery:libbattery_proxy_1.1",
234    "drivers_interface_input:hdi_input",
235    "drivers_interface_light:liblight_proxy_1.0",
236    "eventhandler:libeventhandler",
237    "hiviewdfx_hilog_native:libhilog",
238    "init:libbegetutil",
239    "ipc:ipc_core",
240    "safwk:system_ability_fwk",
241    "samgr:samgr_proxy",
242  ]
243}
244
245##############################systemtest##########################################
246ohos_systemtest("test_battery_undertemperature_shutdown") {
247  module_out_path = "${module_output_path}"
248
249  sources = [
250    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
251    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
252    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
253    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
254    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
255    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
256    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
257    "src/battery_undertemperature_shutdown_test.cpp",
258  ]
259
260  configs = [
261    "${battery_utils}:utils_config",
262    ":module_private_config",
263  ]
264
265  deps = [
266    "${battery_manager_path}/interfaces/innerkits:batterysrv_client",
267    "${hdf_uhdf_path}/utils:libhdf_utils",
268    "//base/powermgr/battery_manager/services:batteryservice",
269    "//drivers/peripheral/battery/charger/ui:libminui",
270    "//third_party/googletest:gtest_main",
271    "//third_party/jsoncpp:jsoncpp",
272  ]
273
274  external_deps = [
275    "ability_base:base",
276    "ability_base:want",
277    "c_utils:utils",
278    "common_event_service:cesfwk_innerkits",
279    "drivers_interface_battery:libbattery_proxy_1.1",
280    "drivers_interface_input:hdi_input",
281    "drivers_interface_light:liblight_proxy_1.0",
282    "eventhandler:libeventhandler",
283    "hiviewdfx_hilog_native:libhilog",
284    "hiviewdfx_hilog_native:libhilog",
285    "init:libbegetutil",
286    "ipc:ipc_core",
287    "safwk:system_ability_fwk",
288    "samgr:samgr_proxy",
289  ]
290}
291
292##############################systemtest##########################################
293ohos_systemtest("test_charger_offline_shutdown") {
294  module_out_path = "${module_output_path}"
295
296  sources = [
297    "//drivers/peripheral/battery/charger/backlight/battery_backlight.cpp",
298    "//drivers/peripheral/battery/charger/led/battery_led.cpp",
299    "//drivers/peripheral/battery/charger/src/charger_thread.cpp",
300    "//drivers/peripheral/battery/charger/vibrate/battery_vibrate.cpp",
301    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_config.cpp",
302    "//drivers/peripheral/battery/interfaces/hdi_service/src/battery_thread.cpp",
303    "//drivers/peripheral/battery/interfaces/hdi_service/src/power_supply_provider.cpp",
304    "src/charger_offline_shutdown_test.cpp",
305  ]
306
307  configs = [
308    "${battery_utils}:utils_config",
309    ":module_private_config",
310  ]
311
312  deps = [
313    "${hdf_uhdf_path}/utils:libhdf_utils",
314    "//drivers/peripheral/battery/charger/ui:libminui",
315    "//third_party/googletest:gtest_main",
316    "//third_party/jsoncpp:jsoncpp",
317  ]
318
319  external_deps = [
320    "c_utils:utils",
321    "drivers_interface_battery:libbattery_proxy_1.1",
322    "drivers_interface_input:hdi_input",
323    "drivers_interface_light:liblight_proxy_1.0",
324    "hiviewdfx_hilog_native:libhilog",
325    "init:libbegetutil",
326    "ipc:ipc_core",
327  ]
328}
329
330##############################systemtest##########################################
331ohos_systemtest("test_battery_dialog") {
332  module_out_path = "${module_output_path}"
333
334  sources = [ "src/battery_dialog_test.cpp" ]
335
336  configs = [
337    "${battery_utils}:utils_config",
338    ":module_private_config",
339  ]
340
341  deps = [
342    "${battery_manager_path}/interfaces/innerkits:batterysrv_client",
343    "${hdf_uhdf_path}/utils:libhdf_utils",
344    "//base/powermgr/battery_manager/services:batteryservice",
345    "//drivers/peripheral/battery/charger/ui:libminui",
346    "//drivers/peripheral/battery/interfaces/hdi_service:libbattery_interface_service_1.1",
347    "//third_party/googletest:gtest_main",
348    "//third_party/jsoncpp:jsoncpp",
349  ]
350
351  external_deps = [
352    "ability_base:base",
353    "ability_base:want",
354    "c_utils:utils",
355    "common_event_service:cesfwk_innerkits",
356    "drivers_interface_battery:libbattery_proxy_1.1",
357    "drivers_interface_input:hdi_input",
358    "drivers_interface_light:liblight_proxy_1.0",
359    "eventhandler:libeventhandler",
360    "hiviewdfx_hilog_native:libhilog",
361    "hiviewdfx_hilog_native:libhilog",
362    "init:libbegetutil",
363    "ipc:ipc_core",
364    "safwk:system_ability_fwk",
365    "samgr:samgr_proxy",
366  ]
367}
368
369group("systemtest") {
370  testonly = true
371
372  deps = [
373    ":test_battery_dialog",
374    ":test_systemtest",
375  ]
376}
377