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("//build/ohos.gni") 15import("//build/test.gni") 16import("../../power.gni") 17 18module_output_path = "drivers_peripheral_power/drivers_peripheral_power" 19power_hdi_service_path = "../../interfaces/hdi_service" 20 21ohos_unittest("hdi_unittest_power") { 22 module_out_path = module_output_path 23 24 include_dirs = [ 25 "../../interfaces/hdi_service/include", 26 "../../utils/include", 27 ] 28 29 sources = [ "src/hdf_power_hdi_test.cpp" ] 30 31 cflags = [ 32 "-Wall", 33 "-Wextra", 34 "-Werror", 35 "-fsigned-char", 36 "-fno-common", 37 "-fno-strict-aliasing", 38 ] 39 40 external_deps = [ 41 "drivers_interface_power:libpower_stub_1.2", 42 "drivers_interface_power:libpower_stub_1.3", 43 "hdf_core:libhdf_utils", 44 "hilog:libhilog", 45 "ipc:ipc_single", 46 ] 47 if (drivers_peripheral_power_c_utils) { 48 external_deps += [ "c_utils:utils" ] 49 } 50 51 if (drivers_peripheral_power_wakeup_cause_path) { 52 defines = [ "DRIVER_PERIPHERAL_POWER_WAKEUP_CAUSE_PATH" ] 53 } 54} 55 56ohos_unittest("hdi_unittest_power_runninglock") { 57 module_out_path = module_output_path 58 59 include_dirs = [ 60 "${power_hdi_service_path}/src", 61 "mock", 62 "../../utils/include", 63 ] 64 65 sources = [ 66 "${power_hdi_service_path}/src/running_lock_counter.cpp", 67 "${power_hdi_service_path}/src/running_lock_impl.cpp", 68 "${power_hdi_service_path}/src/running_lock_timer_handler.cpp", 69 "mock/mock_system_operation.cpp", 70 "mock/mock_wakelock_name.cpp", 71 "src/hdf_power_runninglock_test.cpp", 72 ] 73 74 cflags = [ 75 "-Wall", 76 "-Wextra", 77 "-Werror", 78 "-fsigned-char", 79 "-fno-common", 80 "-fno-strict-aliasing", 81 ] 82 83 external_deps = [ 84 "drivers_interface_power:libpower_proxy_1.0", 85 "hdf_core:libhdf_utils", 86 "hilog:libhilog", 87 "ipc:ipc_single", 88 ] 89 90 if (drivers_peripheral_power_c_utils) { 91 external_deps += [ "c_utils:utils" ] 92 } 93} 94