1# Copyright (C) 2022-2025 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 "safwk:system_ability_fwk", 104 "samgr:samgr_proxy", 105 ] 106 107 if (is_standard_system) { 108 external_deps += [ "googletest:gtest_main" ] 109 } 110 111 subsystem_name = "resourceschedule" 112 part_name = "qos_manager" 113} 114 115ohos_unittest("concurrent_task_controller_interface_test") { 116 module_out_path = module_output_path 117 118 configs = [ ":test_config" ] 119 120 sources = [ "unittest/phone/concurrent_task_controller_interface_test.cpp" ] 121 deps = [ 122 "../etc/param:ffrt_etc", 123 "../frameworks/concurrent_task_client:concurrent_task_client", 124 "../services:concurrentsvc", 125 ] 126 127 external_deps = [ 128 "c_utils:utils", 129 "frame_aware_sched:rtg_interface", 130 "hilog:libhilog", 131 "init:libbegetutil", 132 "safwk:system_ability_fwk", 133 "samgr:samgr_proxy", 134 ] 135 136 if (is_standard_system) { 137 external_deps += [ "googletest:gtest_main" ] 138 } 139 140 subsystem_name = "resourceschedule" 141 part_name = "qos_manager" 142} 143 144ohos_unittest("concurrent_task_service_ability_test") { 145 module_out_path = module_output_path 146 147 configs = [ ":test_config" ] 148 149 sources = [ "unittest/phone/concurrent_task_service_ability_test.cpp" ] 150 deps = [ 151 "../frameworks/concurrent_task_client:concurrent_task_client", 152 "../services:concurrentsvc", 153 ] 154 external_deps = [ 155 "c_utils:utils", 156 "frame_aware_sched:rtg_interface", 157 "hilog:libhilog", 158 "safwk:system_ability_fwk", 159 "samgr:samgr_proxy", 160 ] 161 162 if (is_standard_system) { 163 external_deps += [ "googletest:gtest_main" ] 164 } 165 166 subsystem_name = "resourceschedule" 167 part_name = "qos_manager" 168} 169 170ohos_unittest("qos_interface_test") { 171 module_out_path = module_output_path 172 173 configs = [ ":test_config" ] 174 175 sources = [ "unittest/phone/qos_interface_test.cpp" ] 176 177 deps = [ 178 "../frameworks/concurrent_task_client:concurrent_task_client", 179 "../services:concurrentsvc", 180 ] 181 external_deps = [ 182 "c_utils:utils", 183 "frame_aware_sched:rtg_interface", 184 "hilog:libhilog", 185 "safwk:system_ability_fwk", 186 "samgr:samgr_proxy", 187 ] 188 189 if (is_standard_system) { 190 external_deps += [ "googletest:gtest_main" ] 191 } 192 193 subsystem_name = "resourceschedule" 194 part_name = "qos_manager" 195} 196 197ohos_unittest("qos_policy_test") { 198 module_out_path = module_output_path 199 200 configs = [ ":test_config" ] 201 202 sources = [ "unittest/phone/qos_policy_test.cpp" ] 203 deps = [ 204 "../frameworks/concurrent_task_client:concurrent_task_client", 205 "../services:concurrentsvc", 206 ] 207 external_deps = [ 208 "c_utils:utils", 209 "hilog:libhilog", 210 "safwk:system_ability_fwk", 211 "samgr:samgr_proxy", 212 ] 213 214 if (is_standard_system) { 215 external_deps += [ "googletest:gtest_main" ] 216 } 217 218 subsystem_name = "resourceschedule" 219 part_name = "qos_manager" 220} 221 222ohos_unittest("concurrent_task_service_test") { 223 module_out_path = module_output_path 224 225 configs = [ ":test_config" ] 226 227 sources = [ "unittest/phone/concurrent_task_service_test.cpp" ] 228 deps = [ 229 "../frameworks/concurrent_task_client:concurrent_task_client", 230 "../frameworks/concurrent_task_client/:concurrent_task_idl", 231 "../services:concurrentsvc", 232 ] 233 external_deps = [ 234 "c_utils:utils", 235 "frame_aware_sched:rtg_interface", 236 "hilog:libhilog", 237 "safwk:system_ability_fwk", 238 "samgr:samgr_proxy", 239 ] 240 241 if (is_standard_system) { 242 external_deps += [ "googletest:gtest_main" ] 243 } 244 245 subsystem_name = "resourceschedule" 246 part_name = "qos_manager" 247} 248 249ohos_unittest("qos_test") { 250 module_out_path = module_output_path 251 252 configs = [ ":test_config" ] 253 254 sources = [ "unittest/phone/qos_test.cpp" ] 255 256 deps = [ "../qos:qos" ] 257 external_deps = [ 258 "c_utils:utils", 259 "frame_aware_sched:rtg_interface", 260 "hilog:libhilog", 261 ] 262 263 if (is_standard_system) { 264 external_deps += [ "googletest:gtest_main" ] 265 } 266 267 subsystem_name = "resourceschedule" 268 part_name = "qos_manager" 269} 270 271ohos_unittest("qos_ndk_test") { 272 module_out_path = module_output_path 273 274 configs = [ ":test_config" ] 275 276 sources = [ "unittest/phone/qos_ndk_test.cpp" ] 277 278 deps = [ 279 "../frameworks/native:qos_ndk", 280 "../qos:qos", 281 ] 282 external_deps = [ 283 "c_utils:utils", 284 "frame_aware_sched:rtg_interface", 285 "hilog:libhilog", 286 ] 287 288 if (is_standard_system) { 289 external_deps += [ "googletest:gtest_main" ] 290 } 291 292 subsystem_name = "resourceschedule" 293 part_name = "qos_manager" 294} 295 296group("concurrent_unittest") { 297 testonly = true 298 deps = [] 299 if (!is_asan) { 300 deps += [ 301 ":concurrent_svc_intf_test", 302 ":concurrent_task_client_test", 303 ":concurrent_task_controller_interface_test", 304 ":concurrent_task_service_ability_test", 305 ":concurrent_task_service_test", 306 ":func_loader_test", 307 ":qos_interface_test", 308 ":qos_ndk_test", 309 ":qos_policy_test", 310 ":qos_test", 311 ] 312 } 313} 314