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