1# Copyright (c) 2022 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/adapter/uhdf/uhdf.gni") 17 18module_output_path = "battery_manager_native/batterysrv" 19 20############################################################################### 21config("module_private_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [ 25 "include", 26 "${battery_manager_path}/charger/ui/include", 27 "${battery_manager_path}/charger/led", 28 "${battery_manager_path}/charger/backlight", 29 "${battery_manager_path}/charger/vibrate", 30 "${battery_manager_path}/charger/include", 31 "${battery_manager_path}/services/native/include", 32 "${battery_manager_path}/interfaces/innerkits/native/include", 33 "//drivers/peripheral/powermgr/battery/interfaces/include", 34 "//drivers/peripheral/powermgr/battery/include", 35 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/include", 36 ] 37} 38 39##############################unittest########################################## 40ohos_unittest("test_hdisrv") { 41 module_out_path = module_output_path 42 43 sources = [ 44 "//base/powermgr/battery_manager/charger/backlight/battery_backlight.cpp", 45 "//base/powermgr/battery_manager/charger/led/battery_led.cpp", 46 "//base/powermgr/battery_manager/charger/src/charger_thread.cpp", 47 "//base/powermgr/battery_manager/charger/vibrate/battery_vibrate.cpp", 48 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/battery_config.cpp", 49 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/battery_thread.cpp", 50 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/power_supply_provider.cpp", 51 "src/hdi_service_test.cpp", 52 ] 53 54 configs = [ 55 "${utils_path}:utils_config", 56 ":module_private_config", 57 ] 58 59 deps = [ 60 "${battery_manager_path}/interfaces/innerkits:batterysrv_client", 61 "//base/powermgr/battery_manager/charger/ui:libminui", 62 "//base/powermgr/battery_manager/services:batteryservice", 63 "//base/powermgr/power_manager/interfaces/innerkits:powermgr_client", 64 "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", 65 "//drivers/interface/battery/v1_0:libbattery_proxy_1.0", 66 "//drivers/interface/battery/v1_0:libbattery_stub_1.0", 67 "//drivers/peripheral/powermgr/battery/interfaces/hdi_callback:libbattery_callback", 68 "//third_party/googletest:gmock_main", 69 "//third_party/googletest:gtest_main", 70 "//third_party/jsoncpp:jsoncpp", 71 "//third_party/libpng:libpng", 72 "//utils/native/base:utils", 73 ] 74 75 external_deps = [ 76 "ability_base:base", 77 "ability_base:want", 78 "bundle_framework:appexecfwk_base", 79 "ces_standard:cesfwk_core", 80 "ces_standard:cesfwk_innerkits", 81 "device_driver_framework:libhdf_host", 82 "device_driver_framework:libhdf_ipc_adapter", 83 "device_driver_framework:libhdf_utils", 84 "eventhandler:libeventhandler", 85 "hiviewdfx_hilog_native:libhilog", 86 "input_device_driver:hdi_input", 87 "ipc:ipc_single", 88 "safwk:system_ability_fwk", 89 "samgr_standard:samgr_proxy", 90 ] 91} 92 93##############################unittest########################################## 94ohos_unittest("test_capacity_shutdown") { 95 module_out_path = module_output_path 96 97 sources = [ 98 "//base/powermgr/battery_manager/charger/backlight/battery_backlight.cpp", 99 "//base/powermgr/battery_manager/charger/led/battery_led.cpp", 100 "//base/powermgr/battery_manager/charger/src/charger_thread.cpp", 101 "//base/powermgr/battery_manager/charger/vibrate/battery_vibrate.cpp", 102 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/battery_config.cpp", 103 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/battery_thread.cpp", 104 "//drivers/peripheral/powermgr/battery/interfaces/hdi_service/src/power_supply_provider.cpp", 105 "src/capacity_shutdown_test.cpp", 106 ] 107 108 configs = [ 109 "${utils_path}:utils_config", 110 ":module_private_config", 111 ] 112 113 deps = [ 114 "${battery_manager_path}/interfaces/innerkits:batterysrv_client", 115 "//base/powermgr/battery_manager/charger/ui:libminui", 116 "//base/powermgr/battery_manager/services:batteryservice", 117 "//base/powermgr/power_manager/interfaces/innerkits:powermgr_client", 118 "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", 119 "//drivers/interface/battery/v1_0:libbattery_proxy_1.0", 120 "//drivers/interface/battery/v1_0:libbattery_stub_1.0", 121 "//drivers/peripheral/powermgr/battery/interfaces/hdi_callback:libbattery_callback", 122 "//third_party/googletest:gmock_main", 123 "//third_party/googletest:gtest_main", 124 "//third_party/jsoncpp:jsoncpp", 125 "//third_party/libpng:libpng", 126 "//utils/native/base:utils", 127 ] 128 129 external_deps = [ 130 "device_driver_framework:libhdf_host", 131 "device_driver_framework:libhdf_ipc_adapter", 132 "device_driver_framework:libhdf_utils", 133 "hiviewdfx_hilog_native:libhilog", 134 "input_device_driver:hdi_input", 135 "ipc:ipc_single", 136 ] 137} 138 139group("unittest") { 140 testonly = true 141 deps = [] 142 143 deps += [ 144 ":test_capacity_shutdown", 145 ":test_hdisrv", 146 ] 147} 148