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 "googletest:gtest", 41 "hilog:libhilog", 42 "ipc:ipc_single", 43 "safwk:system_ability_fwk", 44 "samgr:samgr_proxy", 45 ] 46 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 "googletest:gtest", 59 "hilog:libhilog", 60 ] 61 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 "googletest:gtest", 74 "hilog:libhilog", 75 ] 76 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 "googletest:gtest", 89 "hilog:libhilog", 90 ] 91 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 "googletest:gtest", 104 "hilog:libhilog", 105 ] 106 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 "googletest:gtest", 119 "hilog:libhilog", 120 "ipc:ipc_single", 121 "safwk:system_ability_fwk", 122 "samgr:samgr_proxy", 123 ] 124 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 "googletest:gtest", 138 "ipc:ipc_single", 139 "safwk:system_ability_fwk", 140 "samgr:samgr_proxy", 141 ] 142 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