1# Copyright (c) 2023-2024 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") 17import("//foundation/deviceprofile/device_info_manager/deviceprofile.gni") 18 19module_output_path = "device_info_manager/device_info_manager" 20 21config("device_profile_test_config") { 22 cflags = [ 23 "-Dprivate=public", 24 "-Dprotected=public", 25 ] 26 if (!device_info_manager_switch_static_disable) { 27 cflags += [ "-DDEVICE_PROFILE_SWITCH_STATIC_ENABLE" ] 28 } 29} 30 31device_profile_configs = [ 32 "${device_profile_service}:device_info_manager_config", 33 ":device_profile_test_config", 34] 35 36device_profile_deps = [ 37 "${device_profile_common}:distributed_device_profile_common", 38 "${device_profile_innerkits}:distributed_device_profile_sdk", 39 "${device_profile_service}:distributed_device_profile_svr", 40] 41 42device_profile_external_deps = [ 43 "access_token:libaccesstoken_sdk", 44 "access_token:libnativetoken", 45 "access_token:libtoken_setproc", 46 "cJSON:cjson", 47 "c_utils:utils", 48 "common_event_service:cesfwk_innerkits", 49 "config_policy:configpolicy_util", 50 "device_auth:deviceauth_sdk", 51 "device_manager:devicemanagersdk", 52 "dmsfwk:common_sdk", 53 "eventhandler:libeventhandler", 54 "hilog:libhilog", 55 "hisysevent:libhisysevent", 56 "hitrace:hitrace_meter", 57 "init:libbegetutil", 58 "ipc:ipc_core", 59 "kv_store:distributeddata_inner", 60 "relational_store:native_rdb", 61 "safwk:system_ability_fwk", 62 "samgr:samgr_proxy", 63 "syscap_codec:syscap_interface_shared", 64] 65 66ohos_unittest("rdb_adapter_new_test") { 67 module_out_path = module_output_path 68 sources = [ "unittest/rdb_adapter_test.cpp" ] 69 configs = device_profile_configs 70 deps = device_profile_deps 71 external_deps = device_profile_external_deps 72 part_name = "device_info_manager" 73 subsystem_name = "deviceprofile" 74} 75 76ohos_unittest("TrustProfileManagerTest") { 77 module_out_path = module_output_path 78 sources = [ "unittest/trust_profile_manager_test.cpp" ] 79 configs = device_profile_configs 80 deps = device_profile_deps 81 external_deps = device_profile_external_deps 82 part_name = "device_info_manager" 83 subsystem_name = "deviceprofile" 84} 85 86ohos_unittest("distributed_device_profile_client_kv_new_test") { 87 module_out_path = module_output_path 88 sources = [ "unittest/distributed_device_profile_client_kv_test.cpp" ] 89 configs = device_profile_configs 90 deps = device_profile_deps 91 external_deps = device_profile_external_deps 92 part_name = "device_info_manager" 93 subsystem_name = "deviceprofile" 94} 95 96ohos_unittest("device_profile_manager_new_test") { 97 module_out_path = module_output_path 98 sources = [ "unittest/device_profile_manager_test.cpp" ] 99 configs = device_profile_configs 100 deps = device_profile_deps 101 external_deps = device_profile_external_deps 102 part_name = "device_info_manager" 103 subsystem_name = "deviceprofile" 104} 105 106ohos_unittest("ClientRdbTest") { 107 module_out_path = module_output_path 108 sources = [ "unittest/distributed_device_profile_client_rdb_test.cpp" ] 109 configs = device_profile_configs 110 deps = device_profile_deps 111 external_deps = device_profile_external_deps 112 part_name = "device_info_manager" 113 subsystem_name = "deviceprofile" 114} 115 116ohos_unittest("dp_dumper_new_test") { 117 module_out_path = module_output_path 118 sources = [ "unittest/dp_dumper_test.cpp" ] 119 configs = device_profile_configs 120 deps = device_profile_deps 121 external_deps = device_profile_external_deps 122 part_name = "device_info_manager" 123 subsystem_name = "deviceprofile" 124} 125 126ohos_unittest("profile_cache_new_test") { 127 module_out_path = module_output_path 128 sources = [ "unittest/profile_cache_test.cpp" ] 129 configs = device_profile_configs 130 deps = device_profile_deps 131 external_deps = device_profile_external_deps 132 part_name = "device_info_manager" 133 subsystem_name = "deviceprofile" 134} 135 136ohos_unittest("profile_utils_new_test") { 137 module_out_path = module_output_path 138 sources = [ "unittest/profile_utils_test.cpp" ] 139 configs = device_profile_configs 140 deps = device_profile_deps 141 external_deps = device_profile_external_deps 142 part_name = "device_info_manager" 143 subsystem_name = "deviceprofile" 144} 145 146ohos_unittest("kv_adapter_new_test") { 147 module_out_path = module_output_path 148 sources = [ "unittest/kv_adapter_test.cpp" ] 149 configs = device_profile_configs 150 deps = device_profile_deps 151 external_deps = device_profile_external_deps 152 part_name = "device_info_manager" 153 subsystem_name = "deviceprofile" 154} 155 156ohos_unittest("event_handler_factory_new_test") { 157 module_out_path = module_output_path 158 sources = [ "unittest/event_handler_factory_test.cpp" ] 159 configs = device_profile_configs 160 deps = device_profile_deps 161 external_deps = device_profile_external_deps 162 part_name = "device_info_manager" 163 subsystem_name = "deviceprofile" 164} 165 166ohos_unittest("sync_options_new_test") { 167 module_out_path = module_output_path 168 sources = [ "unittest/sync_options_test.cpp" ] 169 configs = device_profile_configs 170 deps = device_profile_deps 171 external_deps = device_profile_external_deps 172 part_name = "device_info_manager" 173 subsystem_name = "deviceprofile" 174} 175 176ohos_unittest("DPSubscribeInfoTest") { 177 module_out_path = module_output_path 178 sources = [ "unittest/dp_subscribe_info_test.cpp" ] 179 configs = device_profile_configs 180 deps = device_profile_deps 181 external_deps = device_profile_external_deps 182 part_name = "device_info_manager" 183 subsystem_name = "deviceprofile" 184} 185 186ohos_unittest("PermissionManagerTest") { 187 module_out_path = module_output_path 188 sources = [ "unittest/permission_manager_test.cpp" ] 189 configs = device_profile_configs 190 deps = device_profile_deps 191 external_deps = device_profile_external_deps 192 part_name = "device_info_manager" 193 subsystem_name = "deviceprofile" 194} 195 196ohos_unittest("IpcUtilsTest") { 197 module_out_path = module_output_path 198 sources = [ "unittest/ipc_utils_test.cpp" ] 199 configs = device_profile_configs 200 deps = device_profile_deps 201 external_deps = device_profile_external_deps 202 part_name = "device_info_manager" 203 subsystem_name = "deviceprofile" 204} 205 206ohos_unittest("content_sensor_manager_test") { 207 module_out_path = module_output_path 208 sources = [ "unittest/content_sensor_manager_test.cpp" ] 209 configs = device_profile_configs 210 deps = device_profile_deps 211 external_deps = device_profile_external_deps 212 part_name = "device_info_manager" 213 subsystem_name = "deviceprofile" 214} 215 216ohos_unittest("content_sensor_pasteboard_info_test") { 217 module_out_path = module_output_path 218 sources = [ "unittest/content_sensor_pasteboard_info_test.cpp" ] 219 configs = device_profile_configs 220 deps = device_profile_deps 221 external_deps = device_profile_external_deps 222 part_name = "device_info_manager" 223 subsystem_name = "deviceprofile" 224} 225 226ohos_unittest("kv_store_death_recipient_test") { 227 module_out_path = module_output_path 228 sources = [ "unittest/kv_store_death_recipient_test.cpp" ] 229 configs = device_profile_configs 230 deps = device_profile_deps 231 external_deps = device_profile_external_deps 232 part_name = "device_info_manager" 233 subsystem_name = "deviceprofile" 234} 235 236ohos_unittest("kv_sync_completed_listener_test") { 237 module_out_path = module_output_path 238 sources = [ "unittest/kv_sync_completed_listener_test.cpp" ] 239 configs = device_profile_configs 240 deps = device_profile_deps 241 external_deps = device_profile_external_deps 242 part_name = "device_info_manager" 243 subsystem_name = "deviceprofile" 244} 245 246ohos_unittest("sync_subscriber_death_recipient_test") { 247 module_out_path = module_output_path 248 sources = [ "unittest/sync_subscriber_death_recipient_test.cpp" ] 249 configs = device_profile_configs 250 deps = device_profile_deps 251 external_deps = device_profile_external_deps 252 part_name = "device_info_manager" 253 subsystem_name = "deviceprofile" 254} 255 256ohos_unittest("dp_content_sensor_test") { 257 module_out_path = module_output_path 258 sources = [ "unittest/dp_content_sensor_test.cpp" ] 259 configs = device_profile_configs 260 deps = device_profile_deps 261 external_deps = device_profile_external_deps 262 part_name = "device_info_manager" 263 subsystem_name = "deviceprofile" 264} 265 266ohos_unittest("ProfileChangeListenerProxyTest") { 267 module_out_path = module_output_path 268 sources = [ "unittest/profile_change_listener_proxy_test.cpp" ] 269 configs = device_profile_configs 270 deps = device_profile_deps 271 external_deps = device_profile_external_deps 272 part_name = "device_info_manager" 273 subsystem_name = "deviceprofile" 274} 275 276ohos_unittest("device_profile_locd_callback_test") { 277 module_out_path = module_output_path 278 sources = [ "unittest/device_profile_locd_callback_test.cpp" ] 279 configs = device_profile_configs 280 deps = device_profile_deps 281 external_deps = device_profile_external_deps 282 part_name = "device_info_manager" 283 subsystem_name = "deviceprofile" 284} 285 286ohos_unittest("subscribe_profile_manager_test") { 287 module_out_path = module_output_path 288 sources = [ "unittest/subscribe_profile_manager_test.cpp" ] 289 configs = device_profile_configs 290 deps = device_profile_deps 291 external_deps = device_profile_external_deps 292 part_name = "device_info_manager" 293 subsystem_name = "deviceprofile" 294} 295 296ohos_unittest("sync_completed_callback_test") { 297 module_out_path = module_output_path 298 sources = [ "unittest/sync_completed_callback_test.cpp" ] 299 configs = device_profile_configs 300 deps = device_profile_deps 301 external_deps = device_profile_external_deps 302 part_name = "device_info_manager" 303 subsystem_name = "deviceprofile" 304} 305 306ohos_unittest("dp_profile_service_new_test") { 307 module_out_path = module_output_path 308 sources = [ "unittest/dp_profile_service_test.cpp" ] 309 configs = device_profile_configs 310 deps = device_profile_deps 311 external_deps = device_profile_external_deps 312 part_name = "device_info_manager" 313 subsystem_name = "deviceprofile" 314} 315 316ohos_unittest("dp_dm_adapter_test") { 317 module_out_path = module_output_path 318 sources = [ "unittest/dm_adapter_test.cpp" ] 319 configs = device_profile_configs 320 deps = device_profile_deps 321 external_deps = device_profile_external_deps 322 part_name = "device_info_manager" 323 subsystem_name = "deviceprofile" 324} 325 326ohos_unittest("distributed_device_profile_stub_new_test") { 327 module_out_path = module_output_path 328 sources = [ "unittest/distributed_device_profile_stub_new_test.cpp" ] 329 configs = device_profile_configs 330 deps = device_profile_deps 331 external_deps = device_profile_external_deps 332 part_name = "device_info_manager" 333 subsystem_name = "deviceprofile" 334 cflags = [ 335 "-Dprivate=public", 336 "-Dprotected=public", 337 ] 338} 339 340ohos_unittest("content_sensor_manager_utils_test") { 341 module_out_path = module_output_path 342 sources = [ "unittest/content_sensor_manager_utils_test.cpp" ] 343 configs = device_profile_configs 344 deps = device_profile_deps 345 external_deps = device_profile_external_deps 346 part_name = "device_info_manager" 347 subsystem_name = "deviceprofile" 348} 349 350ohos_unittest("static_capability_collector_test") { 351 module_out_path = module_output_path 352 sources = [ "unittest/static_capability_collector_test.cpp" ] 353 configs = device_profile_configs 354 deps = device_profile_deps 355 external_deps = device_profile_external_deps 356 part_name = "device_info_manager" 357 subsystem_name = "deviceprofile" 358} 359 360ohos_unittest("static_capability_loader_test") { 361 module_out_path = module_output_path 362 sources = [ "unittest/static_capability_loader_test.cpp" ] 363 configs = device_profile_configs 364 deps = device_profile_deps 365 external_deps = device_profile_external_deps 366 part_name = "device_info_manager" 367 subsystem_name = "deviceprofile" 368} 369 370ohos_unittest("switch_adapter_test") { 371 module_out_path = module_output_path 372 sources = [ "unittest/switch_adapter_test.cpp" ] 373 configs = device_profile_configs 374 deps = device_profile_deps 375 external_deps = device_profile_external_deps 376 part_name = "device_info_manager" 377 subsystem_name = "deviceprofile" 378} 379 380ohos_unittest("profile_control_utils_test") { 381 module_out_path = module_output_path 382 sources = [ "unittest/profile_control_utils_test.cpp" ] 383 configs = device_profile_configs 384 deps = device_profile_deps 385 external_deps = device_profile_external_deps 386 part_name = "device_info_manager" 387 subsystem_name = "deviceprofile" 388} 389 390ohos_unittest("static_profile_manager_test") { 391 module_out_path = module_output_path 392 sources = [ "unittest/static_profile_manager_test.cpp" ] 393 configs = device_profile_configs 394 deps = device_profile_deps 395 external_deps = device_profile_external_deps 396 part_name = "device_info_manager" 397 subsystem_name = "deviceprofile" 398} 399 400ohos_unittest("switch_profile_manager_test") { 401 module_out_path = module_output_path 402 sources = [ "unittest/switch_profile_manager_test.cpp" ] 403 configs = device_profile_configs 404 deps = device_profile_deps 405 external_deps = device_profile_external_deps 406 part_name = "device_info_manager" 407 subsystem_name = "deviceprofile" 408} 409 410ohos_unittest("trust_Device_Profile_test") { 411 module_out_path = module_output_path 412 sources = [ "unittest/trust_device_profile_test.cpp" ] 413 configs = device_profile_configs 414 deps = device_profile_deps 415 external_deps = device_profile_external_deps 416 part_name = "device_info_manager" 417 subsystem_name = "deviceprofile" 418} 419 420ohos_unittest("multi_user_manager_test") { 421 module_out_path = module_output_path 422 sources = [ "unittest/multi_user_manager_test.cpp" ] 423 configs = device_profile_configs 424 deps = device_profile_deps 425 external_deps = device_profile_external_deps 426 part_name = "device_info_manager" 427 subsystem_name = "deviceprofile" 428} 429 430ohos_unittest("dp_account_common_event_test") { 431 module_out_path = module_output_path 432 sources = [ "unittest/dp_account_common_event_test.cpp" ] 433 configs = device_profile_configs 434 deps = device_profile_deps 435 external_deps = device_profile_external_deps 436 part_name = "device_info_manager" 437 subsystem_name = "deviceprofile" 438} 439 440ohos_unittest("session_key_manager_test") { 441 module_out_path = module_output_path 442 sources = [ "unittest/session_key_manager_test.cpp" ] 443 configs = device_profile_configs 444 deps = device_profile_deps 445 external_deps = device_profile_external_deps 446 part_name = "device_info_manager" 447 subsystem_name = "deviceprofile" 448} 449 450ohos_unittest("profile_data_manager_test") { 451 module_out_path = module_output_path 452 sources = [ "unittest/profile_data_manager_test.cpp" ] 453 configs = device_profile_configs 454 deps = device_profile_deps 455 external_deps = device_profile_external_deps 456 part_name = "device_info_manager" 457 subsystem_name = "deviceprofile" 458} 459 460group("unittest") { 461 testonly = true 462 deps = [ 463 ":ClientRdbTest", 464 ":DPSubscribeInfoTest", 465 ":IpcUtilsTest", 466 ":PermissionManagerTest", 467 ":ProfileChangeListenerProxyTest", 468 ":TrustProfileManagerTest", 469 ":content_sensor_manager_test", 470 ":content_sensor_manager_utils_test", 471 ":content_sensor_pasteboard_info_test", 472 ":device_profile_locd_callback_test", 473 ":device_profile_manager_new_test", 474 ":distributed_device_profile_client_kv_new_test", 475 ":distributed_device_profile_stub_new_test", 476 ":dp_account_common_event_test", 477 ":dp_content_sensor_test", 478 ":dp_dm_adapter_test", 479 ":dp_dumper_new_test", 480 ":dp_profile_service_new_test", 481 ":event_handler_factory_new_test", 482 ":kv_adapter_new_test", 483 ":kv_store_death_recipient_test", 484 ":kv_sync_completed_listener_test", 485 ":multi_user_manager_test", 486 ":profile_cache_new_test", 487 ":profile_control_utils_test", 488 ":profile_data_manager_test", 489 ":profile_utils_new_test", 490 ":rdb_adapter_new_test", 491 ":session_key_manager_test", 492 ":static_capability_collector_test", 493 ":static_capability_loader_test", 494 ":static_profile_manager_test", 495 ":subscribe_profile_manager_test", 496 ":switch_adapter_test", 497 ":switch_profile_manager_test", 498 ":sync_completed_callback_test", 499 ":sync_options_new_test", 500 ":sync_subscriber_death_recipient_test", 501 ":trust_Device_Profile_test", 502 ] 503} 504