• 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/shutdown",
30    "${powermgr_service_path}/native/src/suspend",
31    "${powermgr_service_path}/native/src/wakeup",
32    "${powermgr_test_path}/mock/action",
33  ]
34}
35
36deps_ex = [
37  "ability_base:base",
38  "ability_base:want",
39  "ability_runtime:ability_manager",
40  "common_event_service:cesfwk_innerkits",
41  "ipc:ipc_core",
42  "hilog:libhilog",
43  "safwk:system_ability_fwk",
44  "samgr:samgr_proxy",
45  "sensor:sensor_interface_native",
46  "c_utils:utils",
47  "input:libmmi-client",
48]
49
50ohos_unittest("takeover_shutdown_callback_test") {
51  sources = [ "takeover_shutdown_callback_test.cpp" ]
52  configs = [
53    "${powermgr_utils_path}:utils_config",
54    ":module_private_config",
55    "${powermgr_utils_path}:coverage_flags",
56  ]
57  deps = [
58    "${powermgr_inner_api}:powermgr_client",
59    "${powermgr_service_path}:powermgrservice",
60    "//third_party/googletest:gmock_main",
61    "//third_party/googletest:gtest_main",
62  ]
63  external_deps = deps_ex
64  module_out_path = module_output_path
65}
66
67ohos_unittest("async_shutdown_callback_test") {
68  sources = [ "async_shutdown_callback_test.cpp" ]
69  configs = [
70    "${powermgr_utils_path}:utils_config",
71    ":module_private_config",
72    "${powermgr_utils_path}:coverage_flags",
73  ]
74  deps = [
75    "${powermgr_inner_api}:powermgr_client",
76    "${powermgr_service_path}:powermgrservice",
77    "//third_party/googletest:gmock_main",
78    "//third_party/googletest:gtest_main",
79  ]
80  external_deps = deps_ex
81  module_out_path = module_output_path
82}
83
84ohos_unittest("sync_shutdown_callback_test") {
85  sources = [ "sync_shutdown_callback_test.cpp" ]
86  configs = [
87    "${powermgr_utils_path}:utils_config",
88    ":module_private_config",
89    "${powermgr_utils_path}:coverage_flags",
90  ]
91  deps = [
92    "${powermgr_inner_api}:powermgr_client",
93    "${powermgr_service_path}:powermgrservice",
94    "//third_party/googletest:gmock_main",
95    "//third_party/googletest:gtest_main",
96  ]
97  external_deps = deps_ex
98  module_out_path = module_output_path
99}
100
101group("unittest") {
102  testonly = true
103  deps = [
104    ":async_shutdown_callback_test",
105    ":sync_shutdown_callback_test",
106    ":takeover_shutdown_callback_test",
107  ]
108}
109