1# Copyright (c) 2023 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/kv_store/kv_store.gni")
15
16module_output_path = "kv_store/common"
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "../",
24    "${kv_store_base_path}/interfaces/innerkits/distributeddata/include",
25  ]
26}
27
28###############################################################################
29ohos_unittest("ConcurrentMapTest") {
30  module_out_path = module_output_path
31
32  sources = [ "concurrent_map_test.cpp" ]
33
34  configs = [ ":module_private_config" ]
35
36  external_deps = [
37    "c_utils:utils",
38    "hilog:libhilog",
39    "ipc:ipc_single",
40    "safwk:system_ability_fwk",
41    "samgr:samgr_proxy",
42  ]
43
44  deps = [ "//third_party/googletest:gtest" ]
45}
46
47ohos_unittest("ExecutorPoolTest") {
48  module_out_path = module_output_path
49
50  sources = [ "executor_pool_test.cpp" ]
51
52  configs = [ ":module_private_config" ]
53
54  external_deps = [
55    "c_utils:utils",
56    "hilog:libhilog",
57  ]
58
59  deps = [ "//third_party/googletest:gtest" ]
60}
61
62ohos_unittest("LruBucketTest") {
63  module_out_path = module_output_path
64
65  sources = [ "lru_bucket_test.cpp" ]
66
67  configs = [ ":module_private_config" ]
68
69  external_deps = [
70    "c_utils:utils",
71    "hilog:libhilog",
72  ]
73
74  deps = [ "//third_party/googletest:gtest" ]
75}
76
77ohos_unittest("TaskSchedulerTest") {
78  module_out_path = module_output_path
79
80  sources = [ "task_scheduler_test.cpp" ]
81
82  configs = [ ":module_private_config" ]
83
84  external_deps = [
85    "c_utils:utils",
86    "hilog:libhilog",
87  ]
88
89  deps = [ "//third_party/googletest:gtest" ]
90}
91
92ohos_unittest("TraitsTest") {
93  module_out_path = module_output_path
94
95  sources = [ "traits_test.cpp" ]
96
97  configs = [ ":module_private_config" ]
98
99  external_deps = [
100    "c_utils:utils",
101    "hilog:libhilog",
102  ]
103
104  deps = [ "//third_party/googletest:gtest" ]
105}
106
107ohos_unittest("PoolTest") {
108  module_out_path = module_output_path
109
110  sources = [ "pool_test.cpp" ]
111
112  configs = [ ":module_private_config" ]
113
114  external_deps = [
115    "c_utils:utils",
116    "hilog:libhilog",
117    "ipc:ipc_single",
118    "safwk:system_ability_fwk",
119    "samgr:samgr_proxy",
120  ]
121
122  deps = [ "//third_party/googletest:gtest" ]
123}
124
125ohos_unittest("PriorityQueueTest") {
126  module_out_path = module_output_path
127
128  sources = [ "priority_queue_test.cpp" ]
129
130  configs = [ ":module_private_config" ]
131
132  external_deps = [
133    "c_utils:utils",
134    "hilog:libhilog",
135    "ipc:ipc_single",
136    "safwk:system_ability_fwk",
137    "samgr:samgr_proxy",
138  ]
139
140  deps = [ "//third_party/googletest:gtest" ]
141}
142
143###############################################################################
144group("unittest") {
145  testonly = true
146
147  deps = []
148  deps += [
149    ":ConcurrentMapTest",
150    ":ExecutorPoolTest",
151    ":LruBucketTest",
152    ":PoolTest",
153    ":PriorityQueueTest",
154    ":TaskSchedulerTest",
155    ":TraitsTest",
156  ]
157}
158###############################################################################
159