• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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.
13import("//build/test.gni")
14import("//foundation/distributeddatamgr/relational_store/relational_store.gni")
15
16module_output_path = "relational_store/native_rdb"
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "${relational_store_native_path}/rdb/include",
24    "${relational_store_innerapi_path}/rdb/include",
25    "${relational_store_native_path}/rdb/src",
26    "${relational_store_innerapi_path}/appdatafwk/include",
27    "//commonlibrary/c_utils/base/include",
28  ]
29
30  if (relational_store_rdb_support_icu) {
31    include_dirs += [
32      "//third_party/icu/icu4c/source/i18n",
33      "//third_party/icu/icu4c/source/common",
34    ]
35  }
36}
37
38ohos_unittest("NativeRdbTest") {
39  module_out_path = module_output_path
40
41  sources = [
42    "unittest/rdb_attach_test.cpp",
43    "unittest/rdb_delete_test.cpp",
44    "unittest/rdb_distributed_test.cpp",
45    "unittest/rdb_encrypt_decrypt_test.cpp",
46    "unittest/rdb_execute_test.cpp",
47    "unittest/rdb_helper_test.cpp",
48    "unittest/rdb_insert_test.cpp",
49    "unittest/rdb_open_callback_test.cpp",
50    "unittest/rdb_predicates_join_b_test.cpp",
51    "unittest/rdb_predicates_join_test.cpp",
52    "unittest/rdb_predicates_test.cpp",
53    "unittest/rdb_sqlite_shared_result_set_test.cpp",
54    "unittest/rdb_step_result_set_test.cpp",
55    "unittest/rdb_store_concurrent_test.cpp",
56    "unittest/rdb_store_config_test.cpp",
57    "unittest/rdb_store_interface_test.cpp",
58    "unittest/rdb_transaction_test.cpp",
59    "unittest/rdb_update_test.cpp",
60    "unittest/rdb_upgrade_test.cpp",
61    "unittest/rdb_value_bucket_test.cpp",
62  ]
63
64  configs = [ ":module_private_config" ]
65
66  external_deps = [
67    "c_utils:utils",
68    "hilog_native:libhilog",
69    "huks:libhukssdk",
70    "ipc:ipc_core",
71    "relational_store:native_rdb",
72  ]
73
74  deps = [
75    "//third_party/googletest:gtest_main",
76    "//third_party/icu/icu4c:shared_icui18n",
77    "//third_party/icu/icu4c:shared_icuuc",
78    "//third_party/sqlite:sqlite",
79  ]
80}
81
82###############################################################################
83group("unittest") {
84  testonly = true
85
86  deps = [ ":NativeRdbTest" ]
87}
88
89###############################################################################
90
91group("fuzztest") {
92  testonly = true
93  deps = []
94  deps += [
95    "fuzztest/rdbimpl_fuzzer:fuzztest",
96    "fuzztest/rdbstore_fuzzer:fuzztest",
97  ]
98}
99
100###############################################################################
101
102group("distributedtest") {
103  testonly = true
104  deps = []
105  deps += [ "distributedtest/rdb_store_impl_test:distributedtest" ]
106}
107###############################################################################
108