1# Copyright (c) 2022 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/distributeddatamgr/data_object/data_object.gni")
16module_output_path = "data_object/impl"
17
18data_object_base_path = "//foundation/distributeddatamgr/data_object"
19
20data_object_innerkits_path = "${data_object_base_path}/frameworks/innerkitsimpl"
21
22kv_store_include_path =
23    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb"
24
25config("module_private_config") {
26  visibility = [ ":*" ]
27
28  include_dirs = [
29    "./mock/include",
30    "${data_object_innerkits_path}/include/adaptor",
31    "${data_object_innerkits_path}/include/common",
32    "${data_object_innerkits_path}/include/communicator",
33    "${data_object_innerkits_path}/include",
34    "${kv_store_include_path}/include",
35    "${kv_store_include_path}/interfaces/include/",
36    "${kv_store_include_path}/interfaces/include/relational",
37    "//foundation/distributeddatamgr/kv_store/frameworks/common",
38    "${relational_store_path}/interfaces/inner_api/common_type/include",
39  ]
40}
41
42ohos_unittest("NativeObjectStoreTest") {
43  branch_protector_ret = "pac_ret"
44  sanitize = {
45    cfi = true
46    cfi_cross_dso = true
47    debug = false
48  }
49  module_out_path = module_output_path
50
51  sources = [
52    "mock/src/mock_soft_bus.cpp",
53    "src/app_pipe_mgr_test.cpp",
54    "src/communicator_test.cpp",
55    "src/object_store_test.cpp",
56    "src/process_communicator_impl_test.cpp",
57  ]
58
59  configs = [ ":module_private_config" ]
60
61  external_deps = [
62    "access_token:libaccesstoken_sdk",
63    "access_token:libnativetoken",
64    "access_token:libtoken_setproc",
65    "hilog:libhilog",
66  ]
67
68  deps = [
69    "//foundation/distributeddatamgr/data_object/interfaces/innerkits:distributeddataobject_static",
70    "//third_party/googletest:gmock",
71    "//third_party/googletest:gtest_main",
72  ]
73}
74
75group("unittest") {
76  testonly = true
77  deps = [ ":NativeObjectStoreTest" ]
78}
79