# Copyright (c) 2022 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("//build/test.gni") import("../../../../battery.gni") module_output_path = "drivers_peripheral_battery/battery" ############################################################################### config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "include", "../../../include", "../../include", "../systemtest/include", "../../../../utils/include", ] } ##############################unittest########################################## ohos_unittest("test_hdisrv") { module_out_path = module_output_path sources = [ "../../src/battery_config.cpp", "../../src/battery_thread.cpp", "../../src/power_supply_provider.cpp", "src/hdi_service_test.cpp", ] configs = [ ":module_private_config" ] deps = [ "../../../../../../interface/battery/v2_0:libbattery_stub_2.0", "//third_party/cJSON:cjson", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "config_policy:configpolicy_util", "hdf_core:libhdf_host", "hdf_core:libhdf_utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "jsoncpp:jsoncpp", ] if (has_battery_c_utils_part) { external_deps += [ "c_utils:utils" ] } } ohos_unittest("hdi_unittest_battery") { module_out_path = module_output_path sources = [ "src/hdi_interface_test.cpp" ] configs = [ ":module_private_config" ] if (is_standard_system) { external_deps = [ "drivers_interface_battery:libbattery_proxy_2.0", "hdf_core:libhdf_utils", "hilog:libhilog", "ipc:ipc_single", ] if (has_battery_c_utils_part) { external_deps += [ "c_utils:utils" ] } } else { external_deps = [ "hilog:libhilog" ] } } group("unittest") { testonly = true deps = [] deps += [ ":hdi_unittest_battery", ":test_hdisrv", ] }