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