1# Copyright (C) 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/test.gni") 15import("//foundation/filemanagement/dfs_service/distributedfile.gni") 16 17ohos_unittest("clouddisk_rdb_utils_test") { 18 module_out_path = "dfs_service/dfs_service" 19 20 sources = [ 21 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_transaction.cpp", 22 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_utils.cpp", 23 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdbstore.cpp", 24 "${distributedfile_path}/services/clouddisk_database/src/file_column.cpp", 25 "clouddisk_rdb_utils_test.cpp", 26 ] 27 28 include_dirs = [ 29 "${distributedfile_path}/services/clouddisk_database/include", 30 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 31 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 32 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 33 "${distributedfile_path}/adapter/cloud_adapter_example/include", 34 "${distributedfile_path}/test/unittests/cloud_disk_database/include", 35 "include", 36 "${services_path}/cloudfiledaemon/include/cloud_disk", 37 "${distributedfile_path}/utils/log/include", 38 ] 39 40 deps = [ 41 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 42 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 43 "${utils_path}:libdistributedfiledentry", 44 "${utils_path}:libdistributedfileutils", 45 "${utils_path}:libdistributedfileutils_lite", 46 ] 47 48 cflags = [ "--coverage" ] 49 50 ldflags = [ "--coverage" ] 51 52 cflags_cc = [ "--coverage" ] 53 54 external_deps = [ 55 "ability_base:zuri", 56 "ability_runtime:ability_manager", 57 "ability_runtime:dataobs_manager", 58 "app_file_service:sandbox_helper_native", 59 "c_utils:utils", 60 "e2fsprogs:libext2_blkid", 61 "e2fsprogs:libext2_uuid", 62 "eventhandler:libeventhandler", 63 "ffrt:libffrt", 64 "googletest:gmock_main", 65 "googletest:gtest_main", 66 "hilog:libhilog", 67 "hitrace:hitrace_meter", 68 "init:libbegetutil", 69 "ipc:ipc_core", 70 "libfuse:libfuse", 71 "netmanager_base:net_conn_manager_if", 72 "os_account:os_account_innerkits", 73 "power_manager:powermgr_client", 74 "preferences:native_preferences", 75 "relational_store:native_rdb", 76 "safwk:system_ability_fwk", 77 "samgr:samgr_proxy", 78 ] 79 80 defines = [ 81 "private=public", 82 "LOG_DOMAIN=0xD004308", 83 "LOG_TAG=\"CLOUD_DISK_DATABASE_TEST\"", 84 ] 85 86 use_exceptions = true 87} 88 89ohos_unittest("clouddisk_rdbstore_test") { 90 branch_protector_ret = "pac_ret" 91 public_configs = 92 [ "${services_path}/cloudsyncservice:cloud_sync_service_public_config" ] 93 sanitize = { 94 integer_overflow = true 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 99 } 100 module_out_path = "dfs_service/dfs_service" 101 102 sources = [ 103 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_client.cpp", 104 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_stub.cpp", 105 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", 106 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_client.cpp", 107 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_stub.cpp", 108 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_client.cpp", 109 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_stub.cpp", 110 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/service_proxy.cpp", 111 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 112 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 113 "${distributedfile_path}/test/unittests/clouddisk_database/mock/clouddisk_notify_utils_mock.cpp", 114 "${distributedfile_path}/test/unittests/clouddisk_database/mock/clouddisk_rdb_transaction_mock.cpp", 115 "${distributedfile_path}/test/unittests/clouddisk_database/mock/meta_file_clouddisk_mock.cpp", 116 "${distributedfile_path}/test/unittests/clouddisk_database/mock/rdb_mock.cpp", 117 "${distributedfile_path}/test/unittests/clouddisk_database/mock/transaction_mock.cpp", 118 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/cloud_file_utils_mock.cpp", 119 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/parameters.cpp", 120 "clouddisk_rdbstore_test.cpp", 121 ] 122 123 clouddisk_database = [ 124 "${services_path}/clouddisk_database/src/clouddisk_rdb_utils.cpp", 125 "${services_path}/clouddisk_database/src/clouddisk_rdbstore.cpp", 126 "${services_path}/clouddisk_database/src/file_column.cpp", 127 "${services_path}/clouddisk_database/src/clouddisk_sync_helper.cpp", 128 "${services_path}/clouddisk_database/src/clouddisk_notify.cpp", 129 ] 130 131 sources += clouddisk_database 132 133 include_dirs = [ 134 "${services_path}/clouddisk_database/include", 135 "${distributedfile_path}/adapter/cloud_adapter_example/include", 136 "${services_path}/cloudsyncservice/include", 137 "${services_path}/cloudfiledaemon/include", 138 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 139 "${distributedfile_path}/adapter/cloud_adapter_example/include", 140 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 141 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 142 "${utils_path}/log/include", 143 "${distributedfile_path}/test/unittests/clouddisk_database/include", 144 "${distributedfile_path}/test/unittests/clouddisk_database/mock", 145 "${services_path}/cloudfiledaemon/include/cloud_disk", 146 ] 147 148 deps = [ 149 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 150 "${services_path}/cloudsyncservice:cloud_sync_service_proxy", 151 "${utils_path}:libdistributedfileutils", 152 "${utils_path}:libdistributedfileutils_lite", 153 ] 154 155 cflags = [ "--coverage" ] 156 157 ldflags = [ "--coverage" ] 158 159 cflags_cc = [ "--coverage" ] 160 161 external_deps = [ 162 "ability_base:zuri", 163 "ability_runtime:dataobs_manager", 164 "app_file_service:sandbox_helper_native", 165 "c_utils:utils", 166 "e2fsprogs:libext2_blkid", 167 "e2fsprogs:libext2_uuid", 168 "eventhandler:libeventhandler", 169 "ffrt:libffrt", 170 "googletest:gmock_main", 171 "googletest:gtest_main", 172 "hilog:libhilog", 173 "hisysevent:libhisysevent", 174 "hitrace:hitrace_meter", 175 "init:libbegetutil", 176 "ipc:ipc_single", 177 "libfuse:libfuse", 178 "netmanager_base:net_conn_manager_if", 179 "os_account:os_account_innerkits", 180 "preferences:native_preferences", 181 "relational_store:native_rdb", 182 "samgr:samgr_proxy", 183 ] 184 185 defines = [ 186 "private=public", 187 "LOG_DOMAIN=0xD004310", 188 "LOG_TAG=\"CLOUDDISK_DATABASE_TEST\"", 189 ] 190 191 if (cloudsync_service_hicollie_enable) { 192 external_deps += [ "hicollie:libhicollie" ] 193 defines += [ "HICOLLIE_ENABLE" ] 194 } 195 196 if (cloudsync_service_resource_schedule) { 197 external_deps += [ "resource_schedule_service:ressched_client" ] 198 defines += [ "CLOUDSYNC_SERVICE_RESOURCE_SCHEDULE" ] 199 } 200 201 use_exceptions = true 202} 203 204ohos_unittest("clouddisk_rdbstore_static_test") { 205 branch_protector_ret = "pac_ret" 206 public_configs = 207 [ "${services_path}/cloudsyncservice:cloud_sync_service_public_config" ] 208 sanitize = { 209 integer_overflow = true 210 cfi = true 211 cfi_cross_dso = true 212 debug = false 213 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 214 } 215 module_out_path = "dfs_service/dfs_service" 216 217 sources = [ 218 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_client.cpp", 219 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_stub.cpp", 220 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", 221 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_client.cpp", 222 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_optimize_callback_stub.cpp", 223 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_client.cpp", 224 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_callback_stub.cpp", 225 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/service_proxy.cpp", 226 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 227 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 228 "${distributedfile_path}/test/unittests/clouddisk_database/mock/clouddisk_notify_utils_mock.cpp", 229 "${distributedfile_path}/test/unittests/clouddisk_database/mock/clouddisk_rdb_transaction_mock.cpp", 230 "${distributedfile_path}/test/unittests/clouddisk_database/mock/meta_file_clouddisk_mock.cpp", 231 "${distributedfile_path}/test/unittests/clouddisk_database/mock/rdb_mock.cpp", 232 "${distributedfile_path}/test/unittests/clouddisk_database/mock/transaction_mock.cpp", 233 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/cloud_file_utils_mock.cpp", 234 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/parameters.cpp", 235 "clouddisk_rdbstore_static_test.cpp", 236 ] 237 238 clouddisk_database = [ 239 "${services_path}/clouddisk_database/src/clouddisk_rdb_utils.cpp", 240 "${services_path}/clouddisk_database/src/file_column.cpp", 241 "${services_path}/clouddisk_database/src/clouddisk_sync_helper.cpp", 242 "${services_path}/clouddisk_database/src/clouddisk_notify.cpp", 243 ] 244 245 sources += clouddisk_database 246 include_dirs = [ 247 "${services_path}/clouddisk_database/include", 248 "${distributedfile_path}/adapter/cloud_adapter_example/include", 249 "${services_path}/cloudsyncservice/include", 250 "${services_path}/cloudfiledaemon/include", 251 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 252 "${distributedfile_path}/adapter/cloud_adapter_example/include", 253 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 254 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 255 "${utils_path}/log/include", 256 "${distributedfile_path}/test/unittests/clouddisk_database/include", 257 "${distributedfile_path}/test/unittests/clouddisk_database/mock", 258 "${services_path}/cloudfiledaemon/include/cloud_disk", 259 "${services_path}/clouddisk_database/src", 260 ] 261 262 deps = [ 263 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 264 "${services_path}/cloudsyncservice:cloud_sync_service_proxy", 265 "${utils_path}:libdistributedfileutils", 266 "${utils_path}:libdistributedfileutils_lite", 267 ] 268 269 cflags = [ "--coverage" ] 270 271 ldflags = [ "--coverage" ] 272 273 cflags_cc = [ "--coverage" ] 274 275 external_deps = [ 276 "ability_base:zuri", 277 "ability_runtime:dataobs_manager", 278 "app_file_service:sandbox_helper_native", 279 "c_utils:utils", 280 "e2fsprogs:libext2_blkid", 281 "e2fsprogs:libext2_uuid", 282 "eventhandler:libeventhandler", 283 "ffrt:libffrt", 284 "googletest:gmock_main", 285 "googletest:gtest_main", 286 "hilog:libhilog", 287 "hisysevent:libhisysevent", 288 "hitrace:hitrace_meter", 289 "init:libbegetutil", 290 "ipc:ipc_single", 291 "libfuse:libfuse", 292 "netmanager_base:net_conn_manager_if", 293 "os_account:os_account_innerkits", 294 "preferences:native_preferences", 295 "relational_store:native_rdb", 296 "samgr:samgr_proxy", 297 ] 298 299 defines = [ 300 "private=public", 301 "LOG_DOMAIN=0xD004310", 302 "LOG_TAG=\"CLOUDDISK_DATABASE_TEST\"", 303 ] 304 305 if (cloudsync_service_hicollie_enable) { 306 external_deps += [ "hicollie:libhicollie" ] 307 defines += [ "HICOLLIE_ENABLE" ] 308 } 309 310 if (cloudsync_service_resource_schedule) { 311 external_deps += [ "resource_schedule_service:ressched_client" ] 312 defines += [ "CLOUDSYNC_SERVICE_RESOURCE_SCHEDULE" ] 313 } 314 315 use_exceptions = true 316} 317 318ohos_unittest("clouddisk_notify_test") { 319 branch_protector_ret = "pac_ret" 320 public_configs = 321 [ "${services_path}/cloudsyncservice:cloud_sync_service_public_config" ] 322 sanitize = { 323 integer_overflow = true 324 cfi = true 325 cfi_cross_dso = true 326 debug = false 327 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 328 } 329 330 module_out_path = "dfs_service/dfs_service" 331 332 sources = [ 333 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/service_proxy.cpp", 334 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 335 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 336 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_notify.cpp", 337 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_utils.cpp", 338 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_sync_helper.cpp", 339 "${distributedfile_path}/services/clouddisk_database/src/file_column.cpp", 340 "${distributedfile_path}/test/unittests/cloud_disk/mock/clouddisk_rdbstore_mock.cpp", 341 "${distributedfile_path}/test/unittests/clouddisk_database/mock/clouddisk_notify_utils_mock.cpp", 342 "clouddisk_notify_test.cpp", 343 ] 344 345 include_dirs = [ 346 "${distributedfile_path}/services/clouddisk_database/include", 347 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 348 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 349 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 350 "${distributedfile_path}/adapter/cloud_adapter_example/include", 351 "${distributedfile_path}/test/unittests/cloud_disk_database/include", 352 "include", 353 "${services_path}/cloudfiledaemon/include/cloud_disk", 354 "${distributedfile_path}/utils/log/include", 355 ] 356 357 deps = [ 358 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 359 "${services_path}/cloudsyncservice:cloud_sync_service_proxy", 360 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 361 "${utils_path}:libdistributedfiledentry", 362 "${utils_path}:libdistributedfileutils", 363 "${utils_path}:libdistributedfileutils_lite", 364 ] 365 366 cflags = [ "--coverage" ] 367 368 ldflags = [ "--coverage" ] 369 370 cflags_cc = [ "--coverage" ] 371 372 external_deps = [ 373 "ability_base:zuri", 374 "ability_runtime:ability_manager", 375 "ability_runtime:dataobs_manager", 376 "app_file_service:sandbox_helper_native", 377 "c_utils:utils", 378 "e2fsprogs:libext2_blkid", 379 "e2fsprogs:libext2_uuid", 380 "eventhandler:libeventhandler", 381 "ffrt:libffrt", 382 "googletest:gmock_main", 383 "googletest:gtest_main", 384 "hilog:libhilog", 385 "hitrace:hitrace_meter", 386 "init:libbegetutil", 387 "ipc:ipc_core", 388 "libfuse:libfuse", 389 "netmanager_base:net_conn_manager_if", 390 "os_account:os_account_innerkits", 391 "power_manager:powermgr_client", 392 "preferences:native_preferences", 393 "relational_store:native_rdb", 394 "safwk:system_ability_fwk", 395 "samgr:samgr_proxy", 396 ] 397 398 defines = [ 399 "private=public", 400 "LOG_DOMAIN=0xD004308", 401 "LOG_TAG=\"CLOUD_DISK_DATABASE_TEST\"", 402 ] 403 404 use_exceptions = true 405} 406 407ohos_unittest("clouddisk_rdb_transaction_test") { 408 module_out_path = "dfs_service/dfs_service" 409 410 sources = [ 411 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_transaction.cpp", 412 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_utils.cpp", 413 "${distributedfile_path}/services/clouddisk_database/src/file_column.cpp", 414 "${distributedfile_path}/test/unittests/clouddisk_database/include/clouddisk_rdbstore_mock.h", 415 "clouddisk_rdb_transaction_test.cpp", 416 ] 417 418 include_dirs = [ 419 "${distributedfile_path}/services/clouddisk_database/include", 420 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 421 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 422 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 423 "${distributedfile_path}/adapter/cloud_adapter_example/include", 424 "${distributedfile_path}/test/unittests/cloud_disk_database/include", 425 "include", 426 "${services_path}/cloudfiledaemon/include/cloud_disk", 427 "${distributedfile_path}/utils/log/include", 428 ] 429 430 deps = [ 431 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 432 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 433 "${utils_path}:libdistributedfiledentry", 434 "${utils_path}:libdistributedfileutils", 435 "${utils_path}:libdistributedfileutils_lite", 436 ] 437 438 cflags = [ "--coverage" ] 439 440 ldflags = [ "--coverage" ] 441 442 cflags_cc = [ "--coverage" ] 443 444 external_deps = [ 445 "ability_base:zuri", 446 "ability_runtime:ability_manager", 447 "ability_runtime:dataobs_manager", 448 "app_file_service:sandbox_helper_native", 449 "c_utils:utils", 450 "e2fsprogs:libext2_blkid", 451 "e2fsprogs:libext2_uuid", 452 "eventhandler:libeventhandler", 453 "ffrt:libffrt", 454 "googletest:gmock_main", 455 "googletest:gtest_main", 456 "hilog:libhilog", 457 "hitrace:hitrace_meter", 458 "init:libbegetutil", 459 "ipc:ipc_core", 460 "libfuse:libfuse", 461 "netmanager_base:net_conn_manager_if", 462 "os_account:os_account_innerkits", 463 "power_manager:powermgr_client", 464 "relational_store:native_rdb", 465 "safwk:system_ability_fwk", 466 "samgr:samgr_proxy", 467 ] 468 469 defines = [ 470 "private=public", 471 "LOG_DOMAIN=0xD004308", 472 "LOG_TAG=\"CLOUD_DISK_DATABASE_TEST\"", 473 ] 474 475 use_exceptions = true 476} 477 478ohos_unittest("clouddisk_sync_helper_test") { 479 module_out_path = "dfs_service/dfs_service" 480 public_configs = 481 [ "${services_path}/cloudsyncservice:cloud_sync_service_public_config" ] 482 483 sources = [ 484 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_uri_manager.cpp", 485 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/service_proxy.cpp", 486 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 487 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 488 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_transaction.cpp", 489 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_utils.cpp", 490 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_sync_helper.cpp", 491 "${distributedfile_path}/services/clouddisk_database/src/file_column.cpp", 492 "${distributedfile_path}/test/unittests/clouddisk_database/include/clouddisk_rdbstore_mock.h", 493 "clouddisk_sync_helper_test.cpp", 494 ] 495 496 include_dirs = [ 497 "${distributedfile_path}/services/clouddisk_database/include", 498 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 499 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 500 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 501 "${distributedfile_path}/adapter/cloud_adapter_example/include", 502 "${distributedfile_path}/test/unittests/cloud_disk_database/include", 503 "include", 504 "${services_path}/cloudfiledaemon/include/cloud_disk", 505 "${distributedfile_path}/utils/log/include", 506 ] 507 508 deps = [ 509 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 510 "${services_path}/cloudsyncservice:cloud_sync_service_proxy", 511 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 512 "${utils_path}:libdistributedfiledentry", 513 "${utils_path}:libdistributedfileutils", 514 "${utils_path}:libdistributedfileutils_lite", 515 ] 516 517 cflags = [ "--coverage" ] 518 519 ldflags = [ "--coverage" ] 520 521 cflags_cc = [ "--coverage" ] 522 523 external_deps = [ 524 "ability_base:zuri", 525 "ability_runtime:ability_manager", 526 "ability_runtime:dataobs_manager", 527 "app_file_service:sandbox_helper_native", 528 "c_utils:utils", 529 "e2fsprogs:libext2_blkid", 530 "e2fsprogs:libext2_uuid", 531 "eventhandler:libeventhandler", 532 "ffrt:libffrt", 533 "googletest:gmock_main", 534 "googletest:gtest_main", 535 "hilog:libhilog", 536 "hitrace:hitrace_meter", 537 "init:libbegetutil", 538 "ipc:ipc_core", 539 "libfuse:libfuse", 540 "netmanager_base:net_conn_manager_if", 541 "os_account:os_account_innerkits", 542 "power_manager:powermgr_client", 543 "relational_store:native_rdb", 544 "safwk:system_ability_fwk", 545 "samgr:samgr_proxy", 546 ] 547 548 defines = [ 549 "private=public", 550 "LOG_DOMAIN=0xD004308", 551 "LOG_TAG=\"CLOUD_DISK_DATABASE_TEST\"", 552 ] 553 554 use_exceptions = true 555} 556 557ohos_unittest("clouddisk_notify_utils_test") { 558 branch_protector_ret = "pac_ret" 559 public_configs = 560 [ "${services_path}/cloudsyncservice:cloud_sync_service_public_config" ] 561 sanitize = { 562 integer_overflow = true 563 cfi = true 564 cfi_cross_dso = true 565 debug = false 566 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 567 } 568 569 module_out_path = "dfs_service/dfs_service" 570 571 sources = [ 572 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/service_proxy.cpp", 573 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_impl_lite.cpp", 574 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/src/cloud_sync_manager_lite.cpp", 575 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_notify.cpp", 576 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_notify_utils.cpp", 577 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdb_utils.cpp", 578 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_rdbstore.cpp", 579 "${distributedfile_path}/services/clouddisk_database/src/clouddisk_sync_helper.cpp", 580 "${distributedfile_path}/services/clouddisk_database/src/file_column.cpp", 581 "clouddisk_notify_utils_test.cpp", 582 ] 583 584 include_dirs = [ 585 "${distributedfile_path}/services/clouddisk_database/include", 586 "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner", 587 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 588 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner_lite/include", 589 "${distributedfile_path}/adapter/cloud_adapter_example/include", 590 "${distributedfile_path}/test/unittests/cloud_disk_database/include", 591 "include", 592 "${services_path}/cloudfiledaemon/include/cloud_disk", 593 "${distributedfile_path}/utils/log/include", 594 ] 595 596 deps = [ 597 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 598 "${services_path}/cloudsyncservice:cloud_sync_service_proxy", 599 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 600 "${utils_path}:libdistributedfiledentry", 601 "${utils_path}:libdistributedfileutils", 602 "${utils_path}:libdistributedfileutils_lite", 603 ] 604 605 cflags = [ "--coverage" ] 606 607 ldflags = [ "--coverage" ] 608 609 cflags_cc = [ "--coverage" ] 610 611 external_deps = [ 612 "ability_base:zuri", 613 "ability_runtime:ability_manager", 614 "ability_runtime:dataobs_manager", 615 "app_file_service:sandbox_helper_native", 616 "c_utils:utils", 617 "e2fsprogs:libext2_blkid", 618 "e2fsprogs:libext2_uuid", 619 "eventhandler:libeventhandler", 620 "ffrt:libffrt", 621 "googletest:gmock_main", 622 "googletest:gtest_main", 623 "hilog:libhilog", 624 "hitrace:hitrace_meter", 625 "init:libbegetutil", 626 "ipc:ipc_core", 627 "libfuse:libfuse", 628 "netmanager_base:net_conn_manager_if", 629 "os_account:os_account_innerkits", 630 "power_manager:powermgr_client", 631 "preferences:native_preferences", 632 "relational_store:native_rdb", 633 "safwk:system_ability_fwk", 634 "samgr:samgr_proxy", 635 ] 636 637 defines = [ 638 "private=public", 639 "LOG_DOMAIN=0xD004308", 640 "LOG_TAG=\"CLOUD_DISK_DATABASE_TEST\"", 641 ] 642 643 use_exceptions = true 644} 645 646group("clouddisk_database_test") { 647 testonly = true 648 deps = [ 649 ":clouddisk_notify_test", 650 ":clouddisk_notify_utils_test", 651 ":clouddisk_rdb_transaction_test", 652 ":clouddisk_rdb_utils_test", 653 ":clouddisk_rdbstore_static_test", 654 ":clouddisk_rdbstore_test", 655 ":clouddisk_sync_helper_test", 656 ] 657} 658