• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-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("../../thermalmgr.gni")
16
17module_output_path = "thermal_manager/thermal_manager"
18
19###############################################################################
20config("module_private_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "include",
24    "${thermal_manager_path}/test/common/include",
25    "${thermal_service_zidl}/include",
26  ]
27}
28
29deps_ex = [
30  "ability_base:base",
31  "ability_base:want",
32  "ability_runtime:wantagent_innerkits",
33  "access_token:libaccesstoken_sdk",
34  "access_token:libnativetoken",
35  "access_token:libtoken_setproc",
36  "hdf_core:libhdi",
37  "bundle_framework:appexecfwk_base",
38  "common_event_service:cesfwk_innerkits",
39  "c_utils:utils",
40  "libxml2:libxml2",
41  "drivers_interface_thermal:libthermal_proxy_1.1",
42  "hilog:libhilog",
43  "ipc:ipc_core",
44  "power_manager:powermgr_client",
45  "safwk:system_ability_fwk",
46  "samgr:samgr_proxy",
47  "selinux_adapter:librestorecon",
48  "time_service:time_client",
49]
50
51ohos_systemtest("ThermalMgrInterfaceTest") {
52  sanitize = {
53    cfi = true
54    cfi_cross_dso = true
55    debug = false
56    blocklist = "../cfi_blocklist.txt"
57  }
58  module_out_path = "${module_output_path}"
59
60  sources = [
61    "${thermal_manager_path}/test/common/src/thermal_test.cpp",
62    "src/thermal_mgr_interface_test.cpp",
63  ]
64
65  configs = [
66    "${utils_path}:utils_config",
67    "${utils_path}:coverage_flags",
68    ":module_private_config",
69  ]
70
71  include_dirs = [
72    "include",
73    "${thermal_manager_path}/services/native/include",
74    "${thermal_manager_path}/services/native/include/thermal_action",
75    "${thermal_manager_path}/services/native/include/thermal_observer",
76    "${thermal_manager_path}/services/native/include/thermal_policy",
77    "${thermal_manager_path}/services/native/include/thermal_observer/state_machine",
78    "${thermal_manager_path}/services/native/include/thermal_action/action",
79    "${thermal_manager_path}/test/unittest/include",
80    "${thermal_manager_path}/services/zidl/include",
81  ]
82
83  deps = [
84    "${thermal_inner_api}:thermalsrv_client",
85    "${thermal_manager_path}/services:thermalservice",
86    "${thermal_manager_path}/test/common:mock_thermalsrv_client",
87    "${thermal_service_zidl}:thermalmgr_proxy",
88    "${thermal_service_zidl}:thermalmgr_stub",
89  ]
90  external_deps = deps_ex
91
92  external_deps += [
93    "googletest:gmock_main",
94    "googletest:gtest_main",
95  ]
96
97  defines = []
98  if (has_thermal_airplane_manager_part) {
99    defines += [ "HAS_THERMAL_AIRPLANE_MANAGER_PART" ]
100    external_deps += [ "netmanager_base:net_conn_manager_if" ]
101  }
102}
103
104ohos_systemtest("ThermalMgrDialogTest") {
105  sanitize = {
106    cfi = true
107    cfi_cross_dso = true
108    debug = false
109    blocklist = "../cfi_blocklist.txt"
110  }
111  module_out_path = "${module_output_path}"
112
113  sources = [ "src/thermal_mgr_dialog_test.cpp" ]
114
115  configs = [
116    "${utils_path}:utils_config",
117    "${utils_path}:coverage_flags",
118  ]
119
120  include_dirs = [
121    "include",
122    "${thermal_manager_path}/services/zidl/include",
123    "${thermal_manager_path}/services/native/include",
124    "${thermal_manager_path}/services/native/include/thermal_action",
125    "${thermal_manager_path}/services/native/include/thermal_observer",
126    "${thermal_manager_path}/services/native/include/thermal_policy",
127    "${thermal_manager_path}/services/native/include/thermal_observer/state_machine",
128    "${thermal_manager_path}/services/native/include/thermal_action/action",
129  ]
130
131  deps = [
132    "${thermal_manager_path}/services:thermalservice",
133    "${thermal_service_zidl}:thermalmgr_proxy",
134    "${thermal_service_zidl}:thermalmgr_stub",
135    "${utils_path}:thermal_utils",
136  ]
137  external_deps = deps_ex
138
139  external_deps += [
140    "googletest:gmock_main",
141    "googletest:gtest_main",
142  ]
143
144  defines = []
145  if (has_thermal_airplane_manager_part) {
146    defines += [ "HAS_THERMAL_AIRPLANE_MANAGER_PART" ]
147    external_deps += [ "netmanager_base:net_conn_manager_if" ]
148  }
149}
150
151ohos_systemtest("ThermalLevelEventSystemTest") {
152  module_out_path = module_output_path
153
154  sanitize = {
155    cfi = true
156    cfi_cross_dso = true
157    debug = false
158    blocklist = "../cfi_blocklist.txt"
159  }
160
161  sources = [
162    "${thermal_manager_path}/test/common/src/thermal_test.cpp",
163    "src/thermal_level_event_system_test.cpp",
164  ]
165
166  configs = [
167    "${utils_path}:utils_config",
168    ":module_private_config",
169    "${utils_path}:coverage_flags",
170  ]
171
172  deps = [
173    "${thermal_inner_api}:thermalsrv_client",
174    "${thermal_manager_path}/services:thermalservice",
175    "${thermal_manager_path}/test/common:mock_thermalsrv_client",
176    "${thermal_service_zidl}:thermalmgr_stub",
177  ]
178  external_deps = deps_ex
179
180  external_deps += [ "googletest:gtest_main" ]
181
182  defines = []
183  if (defined(global_parts_info) &&
184      defined(global_parts_info.powermgr_battery_manager)) {
185    defines += [ "BATTERY_MANAGER_ENABLE" ]
186    external_deps += [ "battery_manager:batterysrv_client" ]
187  }
188
189  if (has_thermal_airplane_manager_part) {
190    defines += [ "HAS_THERMAL_AIRPLANE_MANAGER_PART" ]
191    external_deps += [ "netmanager_base:net_conn_manager_if" ]
192  }
193}
194
195group("systemtest") {
196  testonly = true
197
198  deps = [
199    ":ThermalLevelEventSystemTest",
200    ":ThermalMgrDialogTest",
201    ":ThermalMgrInterfaceTest",
202  ]
203}
204