• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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/test.gni")
15import("../../../../powermgr.gni")
16import("../../../powermgr_test.gni")
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "include",
23    "include/utils",
24    "${powermgr_service_zidl}/include",
25    "${powermgr_service_zidl}/src/shutdown",
26    "${powermgr_service_path}/native/src/",
27    "${powermgr_service_path}/native/src/actions/",
28    "${powermgr_service_path}/native/src/actions/default",
29    "${powermgr_service_path}/native/src/hibernate",
30    "${powermgr_service_path}/native/src/proximity_sensor_controller",
31    "${powermgr_service_path}/native/src/runninglock",
32    "${powermgr_service_path}/native/src/shutdown",
33    "${powermgr_service_path}/native/src/suspend",
34    "${powermgr_service_path}/native/src/wakeup",
35    "${powermgr_service_path}/native/src/screenoffpre",
36    "${powermgr_test_path}/mock/action",
37  ]
38
39  if (power_manager_feature_wakeup_action) {
40    include_dirs += [ "${powermgr_service_path}/native/src/wakeup_action" ]
41  }
42}
43
44deps_ex = [
45  "ability_base:base",
46  "ability_base:want",
47  "ability_runtime:ability_manager",
48  "cJSON:cjson",
49  "c_utils:utils",
50  "common_event_service:cesfwk_innerkits",
51  "ffrt:libffrt",
52  "hilog:libhilog",
53  "input:libmmi-client",
54  "ipc:ipc_core",
55  "googletest:gmock_main",
56  "googletest:gtest_main",
57  "libxml2:libxml2",
58  "power_manager:power_ffrt",
59  "safwk:system_ability_fwk",
60  "samgr:samgr_proxy",
61  "window_manager:libwm_lite",
62]
63
64if (has_sensors_sensor_part) {
65  deps_ex += [ "sensor:sensor_interface_native" ]
66}
67
68ohos_unittest("takeover_shutdown_callback_test") {
69  sources = [ "takeover_shutdown_callback_test.cpp" ]
70  configs = [
71    "${powermgr_utils_path}:utils_config",
72    ":module_private_config",
73    "${powermgr_utils_path}:coverage_flags",
74  ]
75  deps = [
76    "${powermgr_inner_api}:powermgr_client",
77    "${powermgr_service_path}:powermgrservice",
78  ]
79  external_deps = deps_ex
80  module_out_path = module_output_path
81}
82
83ohos_unittest("async_shutdown_callback_test") {
84  sources = [ "async_shutdown_callback_test.cpp" ]
85  configs = [
86    "${powermgr_utils_path}:utils_config",
87    ":module_private_config",
88    "${powermgr_utils_path}:coverage_flags",
89  ]
90  deps = [
91    "${powermgr_inner_api}:powermgr_client",
92    "${powermgr_service_path}:powermgrservice",
93  ]
94  external_deps = deps_ex
95  module_out_path = module_output_path
96}
97
98ohos_unittest("sync_shutdown_callback_test") {
99  sources = [ "sync_shutdown_callback_test.cpp" ]
100  configs = [
101    "${powermgr_utils_path}:utils_config",
102    ":module_private_config",
103    "${powermgr_utils_path}:coverage_flags",
104  ]
105  deps = [
106    "${powermgr_inner_api}:powermgr_client",
107    "${powermgr_service_path}:powermgrservice",
108  ]
109  external_deps = deps_ex
110  module_out_path = module_output_path
111}
112
113group("unittest") {
114  testonly = true
115  deps = [
116    ":async_shutdown_callback_test",
117    ":sync_shutdown_callback_test",
118    ":takeover_shutdown_callback_test",
119  ]
120}
121