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 20gtest_public_deps = [ "//third_party/googletest:gtest_main" ] 21 22config("test_config") { 23 include_dirs = [ 24 "../include/", 25 "../frameworks/concurrent_task_client/include", 26 "../interfaces/inner_api/", 27 "../services/include/", 28 "//third_party/jsoncpp/include/", 29 "//foundation/resourceschedule/frame_aware_sched/common/include/", 30 ] 31 32 cflags = [ 33 "-Wno-unused-variable", 34 "-Wno-unused-function", 35 ] 36 37 if (target_cpu == "arm64") { 38 defines = [ "ARM64_TEST" ] 39 } 40} 41 42ohos_unittest("concurrent_svc_intf_test") { 43 module_out_path = module_output_path 44 45 configs = [ ":test_config" ] 46 47 sources = [ "unittest/phone/concurrent_svc_intf_test.cpp" ] 48 deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ] 49 external_deps = [ 50 "c_utils:utils", 51 "hilog:libhilog", 52 "ipc:ipc_single", 53 "safwk:system_ability_fwk", 54 "samgr:samgr_proxy", 55 ] 56 57 if (is_standard_system) { 58 public_deps = gtest_public_deps 59 } 60 61 subsystem_name = "resourceschedule" 62 part_name = "qos_manager" 63} 64 65ohos_unittest("concurrent_task_client_test") { 66 module_out_path = module_output_path 67 68 configs = [ ":test_config" ] 69 70 sources = [ "unittest/phone/concurrent_task_client_test.cpp" ] 71 deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ] 72 73 if (is_standard_system) { 74 public_deps = gtest_public_deps 75 } 76 77 external_deps = [ 78 "hilog:libhilog", 79 "ipc:ipc_single", 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 "//third_party/jsoncpp:jsoncpp", 97 ] 98 99 external_deps = [ 100 "c_utils:utils", 101 "hilog:libhilog", 102 "init:libbegetutil", 103 "safwk:system_ability_fwk", 104 "samgr:samgr_proxy", 105 ] 106 107 if (is_standard_system) { 108 public_deps = gtest_public_deps 109 } 110 111 subsystem_name = "resourceschedule" 112 part_name = "qos_manager" 113} 114 115ohos_unittest("concurrent_task_service_ability_test") { 116 module_out_path = module_output_path 117 118 configs = [ ":test_config" ] 119 120 sources = [ "unittest/phone/concurrent_task_service_ability_test.cpp" ] 121 deps = [ 122 "../frameworks/concurrent_task_client:concurrent_task_client", 123 "../services:concurrentsvc", 124 ] 125 external_deps = [ 126 "c_utils:utils", 127 "hilog:libhilog", 128 "safwk:system_ability_fwk", 129 "samgr:samgr_proxy", 130 ] 131 132 if (is_standard_system) { 133 public_deps = gtest_public_deps 134 } 135 136 subsystem_name = "resourceschedule" 137 part_name = "qos_manager" 138} 139 140ohos_unittest("qos_interface_test") { 141 module_out_path = module_output_path 142 143 configs = [ ":test_config" ] 144 145 sources = [ "unittest/phone/qos_interface_test.cpp" ] 146 deps = [ 147 "../frameworks/concurrent_task_client:concurrent_task_client", 148 "../services:concurrentsvc", 149 ] 150 external_deps = [ 151 "c_utils:utils", 152 "hilog:libhilog", 153 "safwk:system_ability_fwk", 154 "samgr:samgr_proxy", 155 ] 156 157 if (is_standard_system) { 158 public_deps = gtest_public_deps 159 } 160 161 subsystem_name = "resourceschedule" 162 part_name = "qos_manager" 163} 164 165ohos_unittest("qos_policy_test") { 166 module_out_path = module_output_path 167 168 configs = [ ":test_config" ] 169 170 sources = [ "unittest/phone/qos_policy_test.cpp" ] 171 deps = [ 172 "../frameworks/concurrent_task_client:concurrent_task_client", 173 "../services:concurrentsvc", 174 ] 175 external_deps = [ 176 "c_utils:utils", 177 "hilog:libhilog", 178 "safwk:system_ability_fwk", 179 "samgr:samgr_proxy", 180 ] 181 182 if (is_standard_system) { 183 public_deps = gtest_public_deps 184 } 185 186 subsystem_name = "resourceschedule" 187 part_name = "qos_manager" 188} 189 190ohos_unittest("concurrent_task_service_test") { 191 module_out_path = module_output_path 192 193 configs = [ ":test_config" ] 194 195 sources = [ "unittest/phone/concurrent_task_service_test.cpp" ] 196 deps = [ 197 "../frameworks/concurrent_task_client:concurrent_task_client", 198 "../services:concurrentsvc", 199 ] 200 external_deps = [ 201 "c_utils:utils", 202 "hilog:libhilog", 203 "safwk:system_ability_fwk", 204 "samgr:samgr_proxy", 205 ] 206 207 if (is_standard_system) { 208 public_deps = gtest_public_deps 209 } 210 211 subsystem_name = "resourceschedule" 212 part_name = "qos_manager" 213} 214 215ohos_unittest("qos_test") { 216 module_out_path = module_output_path 217 218 configs = [ ":test_config" ] 219 220 sources = [ "unittest/phone/qos_test.cpp" ] 221 deps = [ "../qos:qos" ] 222 external_deps = [ 223 "c_utils:utils", 224 "hilog:libhilog", 225 ] 226 227 if (is_standard_system) { 228 public_deps = gtest_public_deps 229 } 230 231 subsystem_name = "resourceschedule" 232 part_name = "qos_manager" 233} 234 235group("concurrent_unittest") { 236 testonly = true 237 deps = [] 238 if (!is_asan) { 239 deps += [ 240 ":concurrent_svc_intf_test", 241 ":concurrent_task_client_test", 242 ":concurrent_task_controller_test", 243 ":concurrent_task_service_ability_test", 244 ":concurrent_task_service_test", 245 ":qos_interface_test", 246 ":qos_policy_test", 247 ":qos_test", 248 ] 249 } 250} 251