1# Copyright (c) 2021-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/ohos.gni") 15import("//build/ohos_var.gni") 16import("//build/test.gni") 17 18module_output_path = "device_info_manager/deviceprofiletest" 19 20device_profile_path = "//foundation/deviceprofile/device_info_manager" 21device_profile_innerkits = "${device_profile_path}/interfaces/innerkits" 22device_profile_service = "${device_profile_path}/services" 23 24device_profile_configs = [ 25 "${device_profile_service}/core:device_info_manager_config", 26 "//foundation/deviceprofile/device_info_manager/test/resource:coverage_flags", 27] 28 29device_profile_deps = [ 30 "${device_profile_innerkits}/core:distributed_device_profile_client", 31 "${device_profile_service}/core:distributed_device_profile", 32 "//third_party/googletest:gtest_main", 33] 34 35device_profile_external_deps = [ 36 "access_token:libaccesstoken_sdk", 37 "access_token:libnativetoken", 38 "access_token:libtoken_setproc", 39 "c_utils:utils", 40 "device_auth:deviceauth_sdk", 41 "device_manager:devicemanagersdk", 42 "dsoftbus:softbus_client", 43 "eventhandler:libeventhandler", 44 "hisysevent_native:libhisysevent", 45 "hiviewdfx_hilog_native:libhilog", 46 "ipc:ipc_core", 47 "kv_store:distributeddata_inner", 48 "syscap_codec:syscap_interface_shared", 49] 50 51ohos_unittest("profile_crud_test") { 52 module_out_path = module_output_path 53 54 sources = [ 55 "unittest/profile_crud_test.cpp", 56 "unittest/test_util.cpp", 57 ] 58 configs = device_profile_configs 59 deps = device_profile_deps 60 external_deps = device_profile_external_deps 61 part_name = "device_info_manager" 62 subsystem_name = "deviceprofile" 63} 64 65ohos_unittest("profile_dm_test") { 66 module_out_path = module_output_path 67 68 sources = [ "unittest/profile_dm_test.cpp" ] 69 configs = device_profile_configs 70 deps = device_profile_deps 71 external_deps = device_profile_external_deps 72 part_name = "device_info_manager" 73 subsystem_name = "deviceprofile" 74} 75 76ohos_unittest("profile_storage_test") { 77 module_out_path = module_output_path 78 79 sources = [ "unittest/profile_storage_test.cpp" ] 80 configs = device_profile_configs 81 deps = device_profile_deps 82 external_deps = device_profile_external_deps 83 part_name = "device_info_manager" 84 subsystem_name = "deviceprofile" 85} 86 87ohos_unittest("event_subscribe_test") { 88 module_out_path = module_output_path 89 90 sources = [ "unittest/event_subscribe_test.cpp" ] 91 configs = device_profile_configs 92 deps = device_profile_deps 93 external_deps = device_profile_external_deps 94 part_name = "device_info_manager" 95 subsystem_name = "deviceprofile" 96} 97 98ohos_unittest("profile_authority_test") { 99 module_out_path = module_output_path 100 101 sources = [ 102 "unittest/profile_authority_test.cpp", 103 "unittest/test_util.cpp", 104 ] 105 configs = device_profile_configs 106 deps = device_profile_deps 107 external_deps = device_profile_external_deps 108 part_name = "device_info_manager" 109 subsystem_name = "deviceprofile" 110} 111 112ohos_unittest("content_sensor_test") { 113 module_out_path = module_output_path 114 115 sources = [ "unittest/content_sensor_test.cpp" ] 116 configs = device_profile_configs 117 deps = device_profile_deps 118 external_deps = device_profile_external_deps 119 part_name = "device_info_manager" 120 subsystem_name = "deviceprofile" 121} 122 123ohos_unittest("profile_change_notification_test") { 124 module_out_path = module_output_path 125 126 sources = [ "unittest/profile_change_notification_test.cpp" ] 127 configs = device_profile_configs 128 deps = device_profile_deps 129 external_deps = device_profile_external_deps 130 part_name = "device_info_manager" 131 subsystem_name = "deviceprofile" 132} 133 134ohos_unittest("profile_entry_test") { 135 module_out_path = module_output_path 136 137 sources = [ "unittest/profile_entry_test.cpp" ] 138 configs = device_profile_configs 139 deps = device_profile_deps 140 external_deps = device_profile_external_deps 141 part_name = "device_info_manager" 142 subsystem_name = "deviceprofile" 143} 144 145ohos_unittest("profile_proxy_test") { 146 module_out_path = module_output_path 147 148 sources = [ "unittest/profile_proxy_test.cpp" ] 149 configs = device_profile_configs 150 deps = device_profile_deps 151 external_deps = device_profile_external_deps 152 part_name = "device_info_manager" 153 subsystem_name = "deviceprofile" 154} 155 156ohos_unittest("service_profile_test") { 157 module_out_path = module_output_path 158 159 sources = [ "unittest/service_profile_test.cpp" ] 160 configs = device_profile_configs 161 deps = device_profile_deps 162 external_deps = device_profile_external_deps 163 part_name = "device_info_manager" 164 subsystem_name = "deviceprofile" 165} 166 167ohos_unittest("subscribe_info_test") { 168 module_out_path = module_output_path 169 170 sources = [ "unittest/subscribe_info_test.cpp" ] 171 configs = device_profile_configs 172 deps = device_profile_deps 173 external_deps = device_profile_external_deps 174 part_name = "device_info_manager" 175 subsystem_name = "deviceprofile" 176} 177 178ohos_unittest("subscribe_manager_test") { 179 module_out_path = module_output_path 180 181 sources = [ "unittest/subscribe_manager_test.cpp" ] 182 configs = device_profile_configs 183 deps = device_profile_deps 184 external_deps = device_profile_external_deps 185 part_name = "device_info_manager" 186 subsystem_name = "deviceprofile" 187} 188 189ohos_unittest("profile_change_handler_test") { 190 module_out_path = module_output_path 191 192 sources = [ "unittest/profile_change_handler_test.cpp" ] 193 configs = device_profile_configs 194 deps = device_profile_deps 195 external_deps = device_profile_external_deps 196 part_name = "device_info_manager" 197 subsystem_name = "deviceprofile" 198} 199 200ohos_unittest("subscribe_info_checker_test") { 201 module_out_path = module_output_path 202 203 sources = [ "unittest/subscribe_info_checker_test.cpp" ] 204 configs = device_profile_configs 205 deps = device_profile_deps 206 external_deps = device_profile_external_deps 207 part_name = "device_info_manager" 208 subsystem_name = "deviceprofile" 209} 210 211ohos_unittest("device_profile_dfx_test") { 212 module_out_path = module_output_path 213 214 sources = [ "unittest/device_profile_dfx_test.cpp" ] 215 configs = device_profile_configs 216 deps = device_profile_deps 217 external_deps = device_profile_external_deps 218 part_name = "device_info_manager" 219 subsystem_name = "deviceprofile" 220} 221 222ohos_unittest("device_profile_utils_test") { 223 module_out_path = module_output_path 224 225 sources = [ "unittest/device_profile_utils_test.cpp" ] 226 configs = device_profile_configs 227 deps = device_profile_deps 228 external_deps = device_profile_external_deps 229 part_name = "device_info_manager" 230 subsystem_name = "deviceprofile" 231} 232 233ohos_unittest("device_profile_service_test") { 234 module_out_path = module_output_path 235 236 sources = [ "unittest/distributed_device_profile_service_test.cpp" ] 237 configs = device_profile_configs 238 deps = device_profile_deps 239 external_deps = device_profile_external_deps 240 part_name = "device_info_manager" 241 subsystem_name = "deviceprofile" 242} 243 244ohos_unittest("profile_event_notifier_proxy_test") { 245 module_out_path = module_output_path 246 247 sources = [ "unittest/profile_event_notifier_proxy_test.cpp" ] 248 configs = device_profile_configs 249 deps = device_profile_deps 250 external_deps = device_profile_external_deps 251 part_name = "device_info_manager" 252 subsystem_name = "deviceprofile" 253} 254 255group("unittest") { 256 testonly = true 257 deps = [ 258 ":content_sensor_test", 259 ":device_profile_dfx_test", 260 ":device_profile_service_test", 261 ":device_profile_utils_test", 262 ":event_subscribe_test", 263 ":profile_authority_test", 264 ":profile_change_handler_test", 265 ":profile_change_notification_test", 266 ":profile_crud_test", 267 ":profile_dm_test", 268 ":profile_entry_test", 269 ":profile_event_notifier_proxy_test", 270 ":profile_proxy_test", 271 ":profile_storage_test", 272 ":service_profile_test", 273 ":subscribe_info_checker_test", 274 ":subscribe_info_test", 275 ":subscribe_manager_test", 276 ] 277} 278