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