• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/ohos_var.gni")
16import("//build/test.gni")
17
18module_output_path = "qos_manager/qos_manager"
19
20config("test_config") {
21  include_dirs = [
22    "../include/",
23    "../common/include",
24    "../frameworks/concurrent_task_client/include",
25    "../interfaces/inner_api/",
26    "../interfaces/kits/",
27    "../services/include/",
28  ]
29
30  cflags = [
31    "-Wno-unused-variable",
32    "-Wno-unused-function",
33  ]
34
35  if (target_cpu == "arm64") {
36    defines = [ "ARM64_TEST" ]
37  }
38}
39
40ohos_unittest("concurrent_svc_intf_test") {
41  module_out_path = module_output_path
42
43  configs = [ ":test_config" ]
44
45  sources = [ "unittest/phone/concurrent_svc_intf_test.cpp" ]
46  deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ]
47  external_deps = [
48    "c_utils:utils",
49    "frame_aware_sched:rtg_interface",
50    "hilog:libhilog",
51    "ipc:ipc_single",
52    "safwk:system_ability_fwk",
53    "samgr:samgr_proxy",
54  ]
55
56  if (is_standard_system) {
57    external_deps += [ "googletest:gtest_main" ]
58  }
59
60  subsystem_name = "resourceschedule"
61  part_name = "qos_manager"
62}
63
64ohos_unittest("concurrent_task_client_test") {
65  module_out_path = module_output_path
66
67  configs = [ ":test_config" ]
68
69  sources = [ "unittest/phone/concurrent_task_client_test.cpp" ]
70  deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ]
71
72  external_deps = [
73    "frame_aware_sched:rtg_interface",
74    "hilog:libhilog",
75    "ipc:ipc_single",
76  ]
77
78  if (is_standard_system) {
79    external_deps += [ "googletest:gtest_main" ]
80  }
81
82  subsystem_name = "resourceschedule"
83  part_name = "qos_manager"
84}
85
86ohos_unittest("func_loader_test") {
87  module_out_path = module_output_path
88
89  configs = [ ":test_config" ]
90
91  sources = [ "unittest/phone/func_loader_test.cpp" ]
92  deps = [
93    "../etc/param:ffrt_etc",
94    "../frameworks/concurrent_task_client:concurrent_task_client",
95    "../services:concurrentsvc",
96  ]
97
98  external_deps = [
99    "c_utils:utils",
100    "frame_aware_sched:rtg_interface",
101    "hilog:libhilog",
102    "init:libbegetutil",
103    "jsoncpp:jsoncpp",
104    "safwk:system_ability_fwk",
105    "samgr:samgr_proxy",
106  ]
107
108  if (is_standard_system) {
109    external_deps += [ "googletest:gtest_main" ]
110  }
111
112  subsystem_name = "resourceschedule"
113  part_name = "qos_manager"
114}
115
116ohos_unittest("concurrent_task_controller_interface_test") {
117  module_out_path = module_output_path
118
119  configs = [ ":test_config" ]
120
121  sources = [ "unittest/phone/concurrent_task_controller_interface_test.cpp" ]
122  deps = [
123    "../etc/param:ffrt_etc",
124    "../frameworks/concurrent_task_client:concurrent_task_client",
125    "../services:concurrentsvc",
126  ]
127
128  external_deps = [
129    "c_utils:utils",
130    "frame_aware_sched:rtg_interface",
131    "hilog:libhilog",
132    "init:libbegetutil",
133    "jsoncpp:jsoncpp",
134    "safwk:system_ability_fwk",
135    "samgr:samgr_proxy",
136  ]
137
138  if (is_standard_system) {
139    external_deps += [ "googletest:gtest_main" ]
140  }
141
142  subsystem_name = "resourceschedule"
143  part_name = "qos_manager"
144}
145
146ohos_unittest("concurrent_task_service_ability_test") {
147  module_out_path = module_output_path
148
149  configs = [ ":test_config" ]
150
151  sources = [ "unittest/phone/concurrent_task_service_ability_test.cpp" ]
152  deps = [
153    "../frameworks/concurrent_task_client:concurrent_task_client",
154    "../services:concurrentsvc",
155  ]
156  external_deps = [
157    "c_utils:utils",
158    "frame_aware_sched:rtg_interface",
159    "hilog:libhilog",
160    "safwk:system_ability_fwk",
161    "samgr:samgr_proxy",
162  ]
163
164  if (is_standard_system) {
165    external_deps += [ "googletest:gtest_main" ]
166  }
167
168  subsystem_name = "resourceschedule"
169  part_name = "qos_manager"
170}
171
172ohos_unittest("qos_interface_test") {
173  module_out_path = module_output_path
174
175  configs = [ ":test_config" ]
176
177  sources = [ "unittest/phone/qos_interface_test.cpp" ]
178
179  deps = [
180    "../frameworks/concurrent_task_client:concurrent_task_client",
181    "../services:concurrentsvc",
182  ]
183  external_deps = [
184    "c_utils:utils",
185    "frame_aware_sched:rtg_interface",
186    "hilog:libhilog",
187    "safwk:system_ability_fwk",
188    "samgr:samgr_proxy",
189  ]
190
191  if (is_standard_system) {
192    external_deps += [ "googletest:gtest_main" ]
193  }
194
195  subsystem_name = "resourceschedule"
196  part_name = "qos_manager"
197}
198
199ohos_unittest("qos_policy_test") {
200  module_out_path = module_output_path
201
202  configs = [ ":test_config" ]
203
204  sources = [ "unittest/phone/qos_policy_test.cpp" ]
205  deps = [
206    "../frameworks/concurrent_task_client:concurrent_task_client",
207    "../services:concurrentsvc",
208  ]
209  external_deps = [
210    "c_utils:utils",
211    "hilog:libhilog",
212    "safwk:system_ability_fwk",
213    "samgr:samgr_proxy",
214  ]
215
216  if (is_standard_system) {
217    external_deps += [ "googletest:gtest_main" ]
218  }
219
220  subsystem_name = "resourceschedule"
221  part_name = "qos_manager"
222}
223
224ohos_unittest("concurrent_task_service_test") {
225  module_out_path = module_output_path
226
227  configs = [ ":test_config" ]
228
229  sources = [ "unittest/phone/concurrent_task_service_test.cpp" ]
230  deps = [
231    "../frameworks/concurrent_task_client:concurrent_task_client",
232    "../services:concurrentsvc",
233  ]
234  external_deps = [
235    "c_utils:utils",
236    "frame_aware_sched:rtg_interface",
237    "hilog:libhilog",
238    "safwk:system_ability_fwk",
239    "samgr:samgr_proxy",
240  ]
241
242  if (is_standard_system) {
243    external_deps += [ "googletest:gtest_main" ]
244  }
245
246  subsystem_name = "resourceschedule"
247  part_name = "qos_manager"
248}
249
250ohos_unittest("qos_test") {
251  module_out_path = module_output_path
252
253  configs = [ ":test_config" ]
254
255  sources = [ "unittest/phone/qos_test.cpp" ]
256
257  deps = [ "../qos:qos" ]
258  external_deps = [
259    "c_utils:utils",
260    "frame_aware_sched:rtg_interface",
261    "hilog:libhilog",
262  ]
263
264  if (is_standard_system) {
265    external_deps += [ "googletest:gtest_main" ]
266  }
267
268  subsystem_name = "resourceschedule"
269  part_name = "qos_manager"
270}
271
272ohos_unittest("qos_ndk_test") {
273  module_out_path = module_output_path
274
275  configs = [ ":test_config" ]
276
277  sources = [ "unittest/phone/qos_ndk_test.cpp" ]
278
279  deps = [
280    "../frameworks/native:qos_ndk",
281    "../qos:qos",
282  ]
283  external_deps = [
284    "c_utils:utils",
285    "frame_aware_sched:rtg_interface",
286    "hilog:libhilog",
287  ]
288
289  if (is_standard_system) {
290    external_deps += [ "googletest:gtest_main" ]
291  }
292
293  subsystem_name = "resourceschedule"
294  part_name = "qos_manager"
295}
296
297group("concurrent_unittest") {
298  testonly = true
299  deps = []
300  if (!is_asan) {
301    deps += [
302      ":concurrent_svc_intf_test",
303      ":concurrent_task_client_test",
304      ":concurrent_task_controller_interface_test",
305      ":concurrent_task_service_ability_test",
306      ":concurrent_task_service_test",
307      ":func_loader_test",
308      ":qos_interface_test",
309      ":qos_ndk_test",
310      ":qos_policy_test",
311      ":qos_test",
312    ]
313  }
314}
315