# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/powermgr/battery_manager/batterymgr.gni") import("//build/test.gni") module_output_path = "battery_manager_native/batterysrv" ############################################################################### config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "include", "//utils/system/safwk/native/include", "//third_party/googletest/googletest/include", "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk", "//base/powermgr/battery_manager/hdi/client/include", "//base/powermgr/power_manager/utils/native/include", "//base/powermgr/battery_manager/hdi/api/include", "//base/notification/ces_standard/interfaces/innerkits/native/include", "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content", ] } ##############################unittest########################################## ohos_unittest("test_batterysrv") { module_out_path = module_output_path sources = [ "//base/powermgr/battery_manager/utils/native/src/test_utils.cpp", "src/battery_service_test.cpp", ] configs = [ "${utils_path}:utils_config", ":module_private_config", ] deps = [ "${battery_manager_path}/interfaces/innerkits:batterysrv_client", "${battery_manager_path}/services:batteryservice", "//drivers/interface/battery/v1_0:libbattery_proxy_1.0", "//drivers/peripheral/powermgr/battery/interfaces/hdi_callback:libbattery_callback", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//utils/native/base:utils", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:intent", "ces_standard:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", ] } ##############################unittest########################################## ohos_unittest("test_batterysubscriber") { module_out_path = module_output_path sources = [ "src/battery_subscriber_test.cpp" ] configs = [ "${utils_path}:utils_config", ":module_private_config", ] deps = [ "${battery_manager_path}/interfaces/innerkits:batterysrv_client", "${battery_manager_path}/services:batteryservice", "//drivers/interface/battery/v1_0:libbattery_proxy_1.0", "//drivers/peripheral/powermgr/battery/interfaces/hdi_callback:libbattery_callback", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//utils/native/base:utils", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_runtime:intent", "ces_standard:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", ] } group("unittest") { testonly = true deps = [] deps += [ ":test_batterysrv", ":test_batterysubscriber", ] }