• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = [ "c_utils:utils" ]
55
56  deps = [ "//third_party/googletest:gtest" ]
57}
58
59ohos_unittest("LruBucketTest") {
60  module_out_path = module_output_path
61
62  sources = [ "lru_bucket_test.cpp" ]
63
64  configs = [ ":module_private_config" ]
65
66  external_deps = [ "c_utils:utils" ]
67
68  deps = [ "//third_party/googletest:gtest" ]
69}
70
71ohos_unittest("TaskSchedulerTest") {
72  module_out_path = module_output_path
73
74  sources = [ "task_scheduler_test.cpp" ]
75
76  configs = [ ":module_private_config" ]
77
78  external_deps = [ "c_utils:utils" ]
79
80  deps = [ "//third_party/googletest:gtest" ]
81}
82
83ohos_unittest("TraitsTest") {
84  module_out_path = module_output_path
85
86  sources = [ "traits_test.cpp" ]
87
88  configs = [ ":module_private_config" ]
89
90  external_deps = [ "c_utils:utils" ]
91
92  deps = [ "//third_party/googletest:gtest" ]
93}
94
95ohos_unittest("PoolTest") {
96  module_out_path = module_output_path
97
98  sources = [ "pool_test.cpp" ]
99
100  configs = [ ":module_private_config" ]
101
102  external_deps = [
103    "c_utils:utils",
104    "hilog:libhilog",
105    "ipc:ipc_single",
106    "safwk:system_ability_fwk",
107    "samgr:samgr_proxy",
108  ]
109
110  deps = [ "//third_party/googletest:gtest" ]
111}
112
113ohos_unittest("PriorityQueueTest") {
114  module_out_path = module_output_path
115
116  sources = [ "priority_queue_test.cpp" ]
117
118  configs = [ ":module_private_config" ]
119
120  external_deps = [
121    "c_utils:utils",
122    "hilog:libhilog",
123    "ipc:ipc_single",
124    "safwk:system_ability_fwk",
125    "samgr:samgr_proxy",
126  ]
127
128  deps = [ "//third_party/googletest:gtest" ]
129}
130
131###############################################################################
132group("unittest") {
133  testonly = true
134
135  deps = []
136  deps += [
137    ":ConcurrentMapTest",
138    ":ExecutorPoolTest",
139    ":LruBucketTest",
140    ":PoolTest",
141    ":PriorityQueueTest",
142    ":TaskSchedulerTest",
143    ":TraitsTest",
144  ]
145}
146###############################################################################
147