106694b06Sopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd. 206694b06Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 306694b06Sopenharmony_ci# you may not use this file except in compliance with the License. 406694b06Sopenharmony_ci# You may obtain a copy of the License at 506694b06Sopenharmony_ci# 606694b06Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 706694b06Sopenharmony_ci# 806694b06Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 906694b06Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1006694b06Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1106694b06Sopenharmony_ci# See the License for the specific language governing permissions and 1206694b06Sopenharmony_ci# limitations under the License. 1306694b06Sopenharmony_ciimport("//build/test.gni") 1406694b06Sopenharmony_ciimport("//foundation/distributeddatamgr/relational_store/relational_store.gni") 1506694b06Sopenharmony_ci 1606694b06Sopenharmony_cimodule_output_path = "relational_store/native_rdb" 1706694b06Sopenharmony_ci 1806694b06Sopenharmony_ci############################################################################### 1906694b06Sopenharmony_ciconfig("module_private_config") { 2006694b06Sopenharmony_ci visibility = [ ":*" ] 2106694b06Sopenharmony_ci 2206694b06Sopenharmony_ci include_dirs = [ 2306694b06Sopenharmony_ci "${relational_store_common_path}/include", 2406694b06Sopenharmony_ci "${relational_store_native_path}/rdb/include", 2506694b06Sopenharmony_ci "${relational_store_innerapi_path}/rdb/include", 2606694b06Sopenharmony_ci "${relational_store_native_path}/dfx/include", 2706694b06Sopenharmony_ci "${relational_store_native_path}/rdb/src", 2806694b06Sopenharmony_ci "${relational_store_innerapi_path}/appdatafwk/include", 2906694b06Sopenharmony_ci "//commonlibrary/c_utils/base/include", 3006694b06Sopenharmony_ci "${common_tool_path}/", 3106694b06Sopenharmony_ci "${kvstore_interface_path}", 3206694b06Sopenharmony_ci ] 3306694b06Sopenharmony_ci 3406694b06Sopenharmony_ci defines = [ "RELATIONAL_STORE" ] 3506694b06Sopenharmony_ci 3606694b06Sopenharmony_ci if (relational_store_rdb_support_icu) { 3706694b06Sopenharmony_ci include_dirs += [ 3806694b06Sopenharmony_ci "//third_party/icu/icu4c/source/i18n", 3906694b06Sopenharmony_ci "//third_party/icu/icu4c/source/common", 4006694b06Sopenharmony_ci ] 4106694b06Sopenharmony_ci } 4206694b06Sopenharmony_ci} 4306694b06Sopenharmony_ci 4406694b06Sopenharmony_ciohos_unittest("NativeRdbMultiThreadTest") { 4506694b06Sopenharmony_ci module_out_path = module_output_path 4606694b06Sopenharmony_ci 4706694b06Sopenharmony_ci sources = [ 4806694b06Sopenharmony_ci "unittest/common.cpp", 4906694b06Sopenharmony_ci "unittest/multiThread/rdb_connection_test.cpp", 5006694b06Sopenharmony_ci ] 5106694b06Sopenharmony_ci 5206694b06Sopenharmony_ci configs = [ ":module_private_config" ] 5306694b06Sopenharmony_ci 5406694b06Sopenharmony_ci external_deps = [ 5506694b06Sopenharmony_ci "ability_base:zuri", 5606694b06Sopenharmony_ci "ability_runtime:dataobs_manager", 5706694b06Sopenharmony_ci "c_utils:utils", 5806694b06Sopenharmony_ci "hilog:libhilog", 5906694b06Sopenharmony_ci "huks:libhukssdk", 6006694b06Sopenharmony_ci "ipc:ipc_core", 6106694b06Sopenharmony_ci "kv_store:distributeddb", 6206694b06Sopenharmony_ci ] 6306694b06Sopenharmony_ci 6406694b06Sopenharmony_ci deps = [ 6506694b06Sopenharmony_ci "${relational_store_innerapi_path}/rdb:native_rdb", 6606694b06Sopenharmony_ci "//third_party/googletest:gtest_main", 6706694b06Sopenharmony_ci "//third_party/icu/icu4c:shared_icui18n", 6806694b06Sopenharmony_ci "//third_party/icu/icu4c:shared_icuuc", 6906694b06Sopenharmony_ci "//third_party/sqlite:sqlite", 7006694b06Sopenharmony_ci ] 7106694b06Sopenharmony_ci} 7206694b06Sopenharmony_ci 7306694b06Sopenharmony_ciohos_unittest("NativeRdbTest") { 7406694b06Sopenharmony_ci module_out_path = module_output_path 7506694b06Sopenharmony_ci 7606694b06Sopenharmony_ci sources = [ 7706694b06Sopenharmony_ci "unittest/big_integer_test.cpp", 7806694b06Sopenharmony_ci "unittest/cache_result_set_test.cpp", 7906694b06Sopenharmony_ci "unittest/common.cpp", 8006694b06Sopenharmony_ci "unittest/connection_test.cpp", 8106694b06Sopenharmony_ci "unittest/raw_data_parser_test.cpp", 8206694b06Sopenharmony_ci "unittest/rd_utils_test.cpp", 8306694b06Sopenharmony_ci "unittest/rdb_attach_test.cpp", 8406694b06Sopenharmony_ci "unittest/rdb_bigint_test.cpp", 8506694b06Sopenharmony_ci "unittest/rdb_delete_test.cpp", 8606694b06Sopenharmony_ci "unittest/rdb_distributed_test.cpp", 8706694b06Sopenharmony_ci "unittest/rdb_double_write_test.cpp", 8806694b06Sopenharmony_ci "unittest/rdb_encrypt_decrypt_test.cpp", 8906694b06Sopenharmony_ci "unittest/rdb_execute_rd_test.cpp", 9006694b06Sopenharmony_ci "unittest/rdb_execute_test.cpp", 9106694b06Sopenharmony_ci "unittest/rdb_get_store_test.cpp", 9206694b06Sopenharmony_ci "unittest/rdb_helper_test.cpp", 9306694b06Sopenharmony_ci "unittest/rdb_insert_test.cpp", 9406694b06Sopenharmony_ci "unittest/rdb_open_callback_test.cpp", 9506694b06Sopenharmony_ci "unittest/rdb_predicates_join_b_test.cpp", 9606694b06Sopenharmony_ci "unittest/rdb_predicates_join_test.cpp", 9706694b06Sopenharmony_ci "unittest/rdb_predicates_test.cpp", 9806694b06Sopenharmony_ci "unittest/rdb_read_only_test.cpp", 9906694b06Sopenharmony_ci "unittest/rdb_security_manager_test.cpp", 10006694b06Sopenharmony_ci "unittest/rdb_sql_utils_test.cpp", 10106694b06Sopenharmony_ci "unittest/rdb_sqlite_shared_result_set_test.cpp", 10206694b06Sopenharmony_ci "unittest/rdb_step_result_get_row_test.cpp", 10306694b06Sopenharmony_ci "unittest/rdb_step_result_set_test.cpp", 10406694b06Sopenharmony_ci "unittest/rdb_store_backup_restore_test.cpp", 10506694b06Sopenharmony_ci "unittest/rdb_store_concurrent_test.cpp", 10606694b06Sopenharmony_ci "unittest/rdb_store_config_test.cpp", 10706694b06Sopenharmony_ci "unittest/rdb_store_impl_test.cpp", 10806694b06Sopenharmony_ci "unittest/rdb_store_interface_test.cpp", 10906694b06Sopenharmony_ci "unittest/rdb_store_rekey_test.cpp", 11006694b06Sopenharmony_ci "unittest/rdb_store_subscribe_test.cpp", 11106694b06Sopenharmony_ci "unittest/rdb_trans_db_test.cpp", 11206694b06Sopenharmony_ci "unittest/rdb_transaction_test.cpp", 11306694b06Sopenharmony_ci "unittest/rdb_update_test.cpp", 11406694b06Sopenharmony_ci "unittest/rdb_upgrade_test.cpp", 11506694b06Sopenharmony_ci "unittest/rdb_utils_test.cpp", 11606694b06Sopenharmony_ci "unittest/rdb_value_bucket_test.cpp", 11706694b06Sopenharmony_ci "unittest/rdb_wal_limit_test.cpp", 11806694b06Sopenharmony_ci "unittest/sqlite_utils_test.cpp", 11906694b06Sopenharmony_ci "unittest/transaction_test.cpp", 12006694b06Sopenharmony_ci "unittest/value_object_test.cpp", 12106694b06Sopenharmony_ci ] 12206694b06Sopenharmony_ci 12306694b06Sopenharmony_ci sources += [ 12406694b06Sopenharmony_ci "../../../frameworks/native/rdb/mock/src/rdb_fault_hiview_reporter.cpp", 12506694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/base_transaction.cpp", 12606694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/connection.cpp", 12706694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/connection_pool.cpp", 12806694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/grd_api_manager.cpp", 12906694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/raw_data_parser.cpp", 13006694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rd_connection.cpp", 13106694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rd_statement.cpp", 13206694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rd_utils.cpp", 13306694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_local_db_observer.cpp", 13406694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_manager_impl.cpp", 13506694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_notifier_stub.cpp", 13606694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_security_manager.cpp", 13706694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_service_proxy.cpp", 13806694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/rdb_sql_statistic.cpp", 13906694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/result_set_proxy.cpp", 14006694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/share_block.cpp", 14106694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/shared_block_serializer_info.cpp", 14206694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_connection.cpp", 14306694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_global_config.cpp", 14406694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_shared_result_set.cpp", 14506694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_sql_builder.cpp", 14606694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_statement.cpp", 14706694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/sqlite_utils.cpp", 14806694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/step_result_set.cpp", 14906694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/string_utils.cpp", 15006694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/task_executor.cpp", 15106694b06Sopenharmony_ci "../../../frameworks/native/rdb/src/trans_db.cpp", 15206694b06Sopenharmony_ci ] 15306694b06Sopenharmony_ci 15406694b06Sopenharmony_ci configs = [ ":module_private_config" ] 15506694b06Sopenharmony_ci 15606694b06Sopenharmony_ci external_deps = [ 15706694b06Sopenharmony_ci "ability_base:zuri", 15806694b06Sopenharmony_ci "ability_runtime:dataobs_manager", 15906694b06Sopenharmony_ci "c_utils:utils", 16006694b06Sopenharmony_ci "hilog:libhilog", 16106694b06Sopenharmony_ci "huks:libhukssdk", 16206694b06Sopenharmony_ci "ipc:ipc_core", 16306694b06Sopenharmony_ci "kv_store:distributeddb", 16406694b06Sopenharmony_ci "samgr:samgr_proxy", 16506694b06Sopenharmony_ci ] 16606694b06Sopenharmony_ci 16706694b06Sopenharmony_ci deps = [ 16806694b06Sopenharmony_ci "${relational_store_innerapi_path}/rdb:native_rdb", 16906694b06Sopenharmony_ci "//third_party/googletest:gtest_main", 17006694b06Sopenharmony_ci "//third_party/icu/icu4c:shared_icui18n", 17106694b06Sopenharmony_ci "//third_party/icu/icu4c:shared_icuuc", 17206694b06Sopenharmony_ci "//third_party/sqlite:sqlite", 17306694b06Sopenharmony_ci ] 17406694b06Sopenharmony_ci} 17506694b06Sopenharmony_ci 17606694b06Sopenharmony_ci############################################################################### 17706694b06Sopenharmony_cigroup("unittest") { 17806694b06Sopenharmony_ci testonly = true 17906694b06Sopenharmony_ci 18006694b06Sopenharmony_ci deps = [ 18106694b06Sopenharmony_ci ":NativeRdbMultiThreadTest", 18206694b06Sopenharmony_ci ":NativeRdbTest", 18306694b06Sopenharmony_ci ] 18406694b06Sopenharmony_ci} 18506694b06Sopenharmony_ci 18606694b06Sopenharmony_ci############################################################################### 18706694b06Sopenharmony_ci 18806694b06Sopenharmony_cigroup("fuzztest") { 18906694b06Sopenharmony_ci testonly = true 19006694b06Sopenharmony_ci deps = [] 19106694b06Sopenharmony_ci deps += [ 19206694b06Sopenharmony_ci "fuzztest/rdbimpl_fuzzer:fuzztest", 19306694b06Sopenharmony_ci "fuzztest/rdbrdutils_fuzzer:fuzztest", 19406694b06Sopenharmony_ci "fuzztest/rdbstore_fuzzer:fuzztest", 19506694b06Sopenharmony_ci "fuzztest/rdstatement_fuzzer:fuzztest", 19606694b06Sopenharmony_ci ] 19706694b06Sopenharmony_ci} 19806694b06Sopenharmony_ci 19906694b06Sopenharmony_ci############################################################################### 20006694b06Sopenharmony_ci 20106694b06Sopenharmony_cigroup("distributedtest") { 20206694b06Sopenharmony_ci testonly = true 20306694b06Sopenharmony_ci deps = [] 20406694b06Sopenharmony_ci deps += [ "distributedtest/rdb_store_impl_test:distributedtest" ] 20506694b06Sopenharmony_ci} 20606694b06Sopenharmony_ci############################################################################### 207