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("//build/test.gni")
15import("../../../../batterymgr.gni")
16
17##############################unittest##########################################
18ohos_unittest("test_batteryclient") {
19  module_out_path = "${module_output_path}"
20  defines = [ "GTEST" ]
21  include_dirs = [
22    "include",
23    "${battery_manager_path}/test/utils",
24  ]
25  sources = [
26    "${battery_manager_path}/test/utils/test_utils.cpp",
27    "src/battery_client_test.cpp",
28  ]
29
30  configs = [
31    "${battery_utils}:utils_config",
32    "${battery_utils}:coverage_flags",
33  ]
34
35  deps = [
36    "${battery_inner_api}:batterysrv_client",
37    "//third_party/googletest:gtest_main",
38  ]
39
40  external_deps = [
41    "c_utils:utils",
42    "common_event_service:cesfwk_innerkits",
43    "hilog:libhilog",
44    "ipc:ipc_core",
45    "safwk:system_ability_fwk",
46    "samgr:samgr_proxy",
47  ]
48}
49
50ohos_unittest("test_batteryclient_death") {
51  module_out_path = "${module_output_path}"
52  defines = [ "BATTERYMGR_DEATHRECIPIENT_UNITTEST" ]
53
54  include_dirs = [
55    "include",
56    "${battery_manager_path}/test/utils",
57  ]
58  sources = [
59    "${battery_manager_path}/test/utils/test_utils.cpp",
60    "src/battery_client_death_recipient_test.cpp",
61  ]
62
63  configs = [
64    "${battery_utils}:utils_config",
65    "${battery_utils}:coverage_flags",
66  ]
67
68  deps = [
69    "${battery_inner_api}:batterysrv_client",
70    "//third_party/googletest:gtest_main",
71  ]
72
73  external_deps = [
74    "c_utils:utils",
75    "common_event_service:cesfwk_innerkits",
76    "hilog:libhilog",
77    "ipc:ipc_core",
78    "safwk:system_ability_fwk",
79    "samgr:samgr_proxy",
80  ]
81}
82