• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/relational_store/native_gdb"
17
18base_sources = [
19  "${relational_store_native_path}/gdb/adapter/src/grd_adapter.cpp",
20  "${relational_store_native_path}/gdb/adapter/src/grd_adapter_manager.cpp",
21  "${relational_store_native_path}/gdb/src/connection.cpp",
22  "${relational_store_native_path}/gdb/src/connection_pool.cpp",
23  "${relational_store_native_path}/gdb/src/db_helper.cpp",
24  "${relational_store_native_path}/gdb/src/db_store_impl.cpp",
25  "${relational_store_native_path}/gdb/src/db_store_manager.cpp",
26  "${relational_store_native_path}/gdb/src/edge.cpp",
27  "${relational_store_native_path}/gdb/src/full_result.cpp",
28  "${relational_store_native_path}/gdb/src/gdb_utils.cpp",
29  "${relational_store_native_path}/gdb/src/graph_connection.cpp",
30  "${relational_store_native_path}/gdb/src/graph_statement.cpp",
31  "${relational_store_native_path}/gdb/src/path.cpp",
32  "${relational_store_native_path}/gdb/src/path_segment.cpp",
33  "${relational_store_native_path}/gdb/src/store_config.cpp",
34  "${relational_store_native_path}/gdb/src/trans_db.cpp",
35  "${relational_store_native_path}/gdb/src/transaction.cpp",
36  "${relational_store_native_path}/gdb/src/transaction_impl.cpp",
37  "${relational_store_native_path}/gdb/src/vertex.cpp",
38  "${relational_store_native_path}/rdb/src/rdb_security_manager.cpp",
39  "${relational_store_native_path}/rdb/src/rdb_store_config.cpp",
40  "${relational_store_native_path}/rdb/src/rdb_time_utils.cpp",
41  "${relational_store_native_path}/rdb/src/sqlite_utils.cpp",
42  "${relational_store_native_path}/rdb/src/string_utils.cpp",
43]
44
45###############################################################################
46
47ohos_unittest("NativeGdbTest") {
48  module_out_path = module_output_path
49
50  include_dirs = [
51    "${relational_store_common_path}/include",
52    "${relational_store_innerapi_path}/gdb/include",
53    "${relational_store_innerapi_path}/rdb/include",
54    "${relational_store_native_path}/gdb/include",
55    "${relational_store_native_path}/gdb/adapter/include",
56    "${relational_store_native_path}/rdb/include",
57  ]
58
59  sources = base_sources
60  sources += [
61    "unittest/gdb_encrypt_test.cpp",
62    "unittest/gdb_execute_test.cpp",
63    "unittest/gdb_function_test.cpp",
64    "unittest/gdb_grdapi_test.cpp",
65    "unittest/gdb_multi_thread_test.cpp",
66    "unittest/gdb_query_test.cpp",
67    "unittest/gdb_transaction_test.cpp",
68  ]
69
70  external_deps = [
71    "c_utils:utils",
72    "file_api:securitylabel",
73    "googletest:gtest_main",
74    "hilog:libhilog",
75    "hisysevent:libhisysevent",
76    "hitrace:hitrace_meter",
77    "huks:libhukssdk",
78    "json:nlohmann_json_static",
79    "kv_store:distributeddata_inner",
80  ]
81  if (arkdata_db_core_is_exists) {
82    defines = [ "ARKDATA_DB_CORE_IS_EXISTS" ]
83  }
84}
85
86ohos_unittest("NativeGdbAdaptTest") {
87  module_out_path = module_output_path
88
89  include_dirs = [
90    "${relational_store_common_path}/include",
91    "${relational_store_innerapi_path}/gdb/include",
92    "${relational_store_innerapi_path}/rdb/include",
93    "${relational_store_native_path}/gdb/include",
94    "${relational_store_native_path}/gdb/adapter/include",
95    "${relational_store_native_path}/rdb/include",
96  ]
97
98  sources = base_sources
99  sources += [ "unittest/gdb_adapt_test.cpp" ]
100
101  external_deps = [
102    "c_utils:utils",
103    "file_api:securitylabel",
104    "googletest:gmock",
105    "googletest:gtest_main",
106    "hilog:libhilog",
107    "hisysevent:libhisysevent",
108    "hitrace:hitrace_meter",
109    "huks:libhukssdk",
110    "json:nlohmann_json_static",
111    "kv_store:distributeddata_inner",
112  ]
113  if (arkdata_db_core_is_exists) {
114    defines = [ "ARKDATA_DB_CORE_IS_EXISTS" ]
115  }
116}
117
118###############################################################################
119group("unittest") {
120  testonly = true
121
122  deps = [
123    ":NativeGdbAdaptTest",
124    ":NativeGdbTest",
125  ]
126}
127
128###############################################################################
129
130group("fuzztest") {
131  testonly = true
132  deps = []
133  deps += [ "fuzztest/gdbstore_fuzzer:fuzztest" ]
134}
135###############################################################################
136