# Copyright (c) 2021-2023 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("../../powermgr.gni") import("../powermgr_test.gni") module_output_path = "${powermgr_part_name}/powermgr_native" ############################################################################### config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "include", "mock", "include/utils", "${powermgr_service_zidl}/include", "${powermgr_service_zidl}/src/shutdown", "${powermgr_service_path}/native/src/", "${powermgr_service_path}/native/src/actions/", "${powermgr_service_path}/native/src/actions/default", "${powermgr_service_path}/native/src/shutdown", "${powermgr_service_path}/native/src/suspend", "${powermgr_service_path}/native/src/wakeup", "${powermgr_test_path}/mock/action", ] } config("module_mock_private_config") { include_dirs = [ "include/mock", "mock", "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include/", "//commonlibrary/c_utils/base/include/", "${powermgr_service_zidl}/include", "${powermgr_service_path}/test/mock/action", ] } deps_ex = [ "ability_base:base", "ability_base:want", "ability_runtime:ability_manager", "config_policy:configpolicy_util", "common_event_service:cesfwk_innerkits", "ipc:ipc_core", "hilog:libhilog", "safwk:system_ability_fwk", "samgr:samgr_proxy", "sensor:sensor_interface_native", "c_utils:utils", "input:libmmi-client", ] defs = [ "POWER_GTEST" ] ##############################client_test########################################## ohos_unittest("test_power_mgr_client") { module_out_path = module_output_path sources = [ "src/power_mgr_client_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] if (has_display_manager_part) { deps_ex += [ "display_manager:displaymgr" ] } external_deps = deps_ex } ##############################unittest########################################## ohos_unittest("test_register_callback_mode") { module_out_path = module_output_path sources = [ "src/power_register_callback_mode_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_get_mode") { module_out_path = module_output_path sources = [ "src/power_get_mode_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_set_mode") { module_out_path = module_output_path sources = [ "src/power_set_mode_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_device_mode") { module_out_path = module_output_path sources = [ "src/power_device_mode_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_running_lock") { module_out_path = module_output_path sources = [ "src/running_lock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_service") { module_out_path = module_output_path sources = [ "src/power_mgr_service_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_service_death") { module_out_path = module_output_path sources = [ "mock/mock_power_remote_object.cpp", "src/power_mgr_service_death_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] defines = [ "POWERMGR_SERVICE_DEATH_UT" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("ces_system") { module_out_path = module_output_path sources = [ "src/ces_system_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_state_level_framework") { module_out_path = module_output_path resource_config_file = "${powermgr_root_path}/test/unittest/resources/ohos_test.xml" sources = [ "src/power_state_level_framework_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_state_machine") { module_out_path = module_output_path sources = [ "src/power_state_machine_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_mock") { module_out_path = module_output_path sources = [ "src/power_mgr_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_fail_check") { module_out_path = module_output_path sources = [ "src/power_mgr_fail_check_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } if (false) { ohos_unittest("test_power_mgr_notify") { module_out_path = module_output_path sources = [ "src/power_mgr_notify_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } } ##############################coveragetest########################################## ohos_unittest("test_power_mgr_util") { module_out_path = module_output_path include_dirs = [ "${powermgr_utils_path}/permission/include", "${powermgr_utils_path}/param/include", "${powermgr_utils_path}/setting/include", "src/mock", ] sources = [ "${powermgr_utils_path}/param/src/sysparam.cpp", "${powermgr_utils_path}/permission/src/permission.cpp", "${powermgr_utils_path}/setting/src/setting_observer.cpp", "${powermgr_utils_path}/setting/src/setting_provider.cpp", "src/mock/mock_accesstoken_kit.cpp", "src/power_mgr_util_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${ability_runtime_path}/interfaces/inner_api/dataobs_manager:dataobs_manager", "${powermgr_utils_path}/param:power_sysparam", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "data_share:datashare_common", "data_share:datashare_consumer", "init:libbeget_proxy", "init:libbegetutil", ] external_deps += deps_ex } ohos_unittest("test_power_mock_object") { module_out_path = module_output_path sources = [ "${powermgr_service_zidl}/src/power_mgr_proxy.cpp", "mock/mock_power_remote_object.cpp", "src/mock/power_mock_object_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_mock_parcel") { module_out_path = module_output_path sources = [ "${powermgr_service_zidl}/src/power_mgr_proxy.cpp", "mock/mock_message_parcel.cpp", "mock/mock_parcel.cpp", "src/mock/power_mock_parcel_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_utils_path}/permission:power_permission", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_mock_peer") { module_out_path = module_output_path sources = [ "${powermgr_service_zidl}/src/power_mgr_proxy.cpp", "mock/mock_peer_holder.cpp", "src/mock/power_mock_peer_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_mock_proxy") { module_out_path = module_output_path sources = [ "${powermgr_service_zidl}/src/power_mgr_proxy.cpp", "mock/mock_message_parcel.cpp", "mock/mock_parcel.cpp", "src/mock/power_mock_proxy_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] defines = [ "MOCK_WRITE_INTERFACE_TOKEN_RETURN_TRUE", "MOCK_MOCK_READSTRING_DESCRIPTIR", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("power_state_machine_native_test") { module_out_path = module_output_path defines = defs sources = [ "src/native_power_state_machine_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_running_lock_native") { module_out_path = module_output_path defines = defs sources = [ "src/running_lock_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_service_native") { module_out_path = module_output_path defines = defs defines += [ "THERMAL_GTEST" ] sources = [ "src/power_mgr_service_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_device_state_action_native") { module_out_path = module_output_path defines = defs sources = [ "src/device_state_action_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] deps_ex += [ "display_manager:displaymgr" ] external_deps = deps_ex } ohos_unittest("test_power_mgr_dump") { module_out_path = module_output_path sources = [ "src/power_mgr_dump_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_mgr_client_native") { module_out_path = module_output_path defines = defs sources = [ "src/power_mgr_client_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("power_mode_module_native_test") { module_out_path = module_output_path defines = defs sources = [ "src/power_mode_module_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_running_lock_hub_native") { module_out_path = module_output_path defines = defs include_dirs = [ "${powermgr_service_path}/native/src/actions/default/suspend" ] sources = [ "src/running_lock_hub_native_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] defines += [ "THERMAL_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_running_lock_mock") { module_out_path = module_output_path sources = [ "src/running_lock_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_suspend_parse") { module_out_path = module_output_path sources = [ "src/power_suspend_parse_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "THERMAL_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_wakeup_parse") { module_out_path = module_output_path sources = [ "src/power_wakeup_parse_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "THERMAL_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_suspend") { module_out_path = module_output_path sources = [ "src/power_suspend_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "POWERMGR_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_wakeup") { module_out_path = module_output_path sources = [ "src/power_wakeup_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "POWERMGR_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_shutdown_clinet") { module_out_path = module_output_path sources = [ "src/shutdown_client_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgrservice", "//third_party/googletest:gtest_main", ] external_deps = deps_ex } ohos_unittest("test_power_service_mock") { module_out_path = module_output_path sources = [ "src/power_service_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "POWERMGR_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/permission:power_permission", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_getcontroller_mock") { module_out_path = module_output_path sources = [ "src/power_getcontroller_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "POWERMGR_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/permission:power_permission", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_screenon_mock") { module_out_path = module_output_path sources = [ "src/power_screenon_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] defines = [ "POWERMGR_GTEST" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/permission:power_permission", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ohos_unittest("test_power_parsesources_mock") { module_out_path = module_output_path sources = [ "src/power_parsesources_mock_test.cpp" ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", ":module_mock_private_config", "${powermgr_utils_path}:coverage_flags", ] include_dirs = [ "${powermgr_service_path}/native/src/setting/" ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/permission:power_permission", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "ipc:ipc_core", "samgr:samgr_proxy", ] external_deps += deps_ex } ################################powermgrdialog################################ ohos_unittest("test_power_mgr_powerdialog") { module_out_path = module_output_path sources = [ "mock/mock_power_remote_object.cpp", "src/power_mgr_powerdialog_test.cpp", ] configs = [ "${powermgr_utils_path}:utils_config", ":module_private_config", "${powermgr_utils_path}:coverage_flags", ] deps = [ "${powermgr_inner_api}:powermgr_client", "${powermgr_service_path}:powermgr_stub", "${powermgr_service_path}:powermgrservice", "${powermgr_service_path}/native/src/actions:powermgr_actions", "${powermgr_utils_path}/param:power_sysparam", "${powermgr_utils_path}/permission:power_permission", "${powermgr_utils_path}/setting:power_setting", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/libxml2:libxml2", ] external_deps = deps_ex } group("unittest") { testonly = true deps = [ ":power_mode_module_native_test", ":power_state_machine_native_test", ":test_device_state_action_native", ":test_mock_parcel", ":test_mock_peer", ":test_mock_proxy", ":test_power_device_mode", ":test_power_getcontroller_mock", ":test_power_mgr_client", ":test_power_mgr_client_native", ":test_power_mgr_dump", ":test_power_mgr_mock", ":test_power_mgr_powerdialog", ":test_power_mgr_service", ":test_power_mgr_service_death", ":test_power_mgr_service_native", ":test_power_mgr_util", ":test_power_mock_object", ":test_power_parsesources_mock", ":test_power_screenon_mock", ":test_power_service_mock", ":test_power_set_mode", ":test_power_shutdown_clinet", ":test_power_state_level_framework", ":test_power_state_machine", ":test_power_suspend", ":test_power_suspend_parse", ":test_power_wakeup", ":test_power_wakeup_parse", ":test_running_lock", ":test_running_lock_hub_native", ":test_running_lock_mock", ":test_running_lock_native", ] }