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("//base/account/os_account/os_account.gni") 15import("//build/test.gni") 16 17module_output_path = "os_account/tools" 18 19ohos_unittest("account_command_create_test") { 20 module_out_path = module_output_path 21 22 include_dirs = [] 23 24 sources = [ 25 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 26 "${tools_path}/acm/src/account_command.cpp", 27 "account_command_create_test.cpp", 28 ] 29 30 configs = [ 31 "${ability_runtime_path}/tools/aa:ability_command_config", 32 "${tools_path}/acm:tools_acm_config", 33 ] 34 35 cflags = [] 36 if (target_cpu == "arm") { 37 cflags += [ "-DBINDER_IPC_32BIT" ] 38 } 39 40 deps = [ 41 "${common_path}:libaccount_common", 42 "${os_account_core_path}:os_account_core", 43 "//third_party/googletest:gtest_main", 44 ] 45 46 external_deps = [ 47 "c_utils:utils", 48 "hiviewdfx_hilog_native:libhilog", 49 "ipc:ipc_core", 50 ] 51} 52 53ohos_unittest("account_command_delete_test") { 54 module_out_path = module_output_path 55 56 include_dirs = [] 57 58 sources = [ 59 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 60 "${tools_path}/acm/src/account_command.cpp", 61 "account_command_delete_test.cpp", 62 ] 63 64 configs = [ 65 "${ability_runtime_path}/tools/aa:ability_command_config", 66 "${tools_path}/acm:tools_acm_config", 67 ] 68 69 cflags = [] 70 if (target_cpu == "arm") { 71 cflags += [ "-DBINDER_IPC_32BIT" ] 72 } 73 74 deps = [ 75 "${common_path}:libaccount_common", 76 "${os_account_core_path}:os_account_core", 77 "//third_party/googletest:gtest_main", 78 ] 79 80 external_deps = [ 81 "c_utils:utils", 82 "hiviewdfx_hilog_native:libhilog", 83 "ipc:ipc_core", 84 ] 85} 86 87ohos_unittest("account_command_dump_test") { 88 module_out_path = module_output_path 89 90 include_dirs = [] 91 92 sources = [ 93 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 94 "${tools_path}/acm/src/account_command.cpp", 95 "account_command_dump_test.cpp", 96 ] 97 98 configs = [ 99 "${ability_runtime_path}/tools/aa:ability_command_config", 100 "${tools_path}/acm:tools_acm_config", 101 ] 102 103 cflags = [] 104 if (target_cpu == "arm") { 105 cflags += [ "-DBINDER_IPC_32BIT" ] 106 } 107 108 deps = [ 109 "${common_path}:libaccount_common", 110 "${os_account_core_path}:os_account_core", 111 "//third_party/googletest:gtest_main", 112 ] 113 114 external_deps = [ 115 "c_utils:utils", 116 "hiviewdfx_hilog_native:libhilog", 117 "ipc:ipc_core", 118 ] 119} 120 121ohos_unittest("account_command_set_test") { 122 module_out_path = module_output_path 123 124 include_dirs = [] 125 126 sources = [ 127 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 128 "${tools_path}/acm/src/account_command.cpp", 129 "account_command_set_test.cpp", 130 ] 131 132 configs = [ 133 "${ability_runtime_path}/tools/aa:ability_command_config", 134 "${tools_path}/acm:tools_acm_config", 135 ] 136 137 cflags = [] 138 if (target_cpu == "arm") { 139 cflags += [ "-DBINDER_IPC_32BIT" ] 140 } 141 142 deps = [ 143 "${common_path}:libaccount_common", 144 "${os_account_core_path}:os_account_core", 145 "//third_party/googletest:gtest_main", 146 ] 147 148 external_deps = [ 149 "c_utils:utils", 150 "hiviewdfx_hilog_native:libhilog", 151 "ipc:ipc_core", 152 ] 153} 154 155ohos_unittest("account_command_switch_test") { 156 module_out_path = module_output_path 157 158 include_dirs = [] 159 160 sources = [ 161 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 162 "${tools_path}/acm/src/account_command.cpp", 163 "account_command_switch_test.cpp", 164 ] 165 166 configs = [ 167 "${ability_runtime_path}/tools/aa:ability_command_config", 168 "${tools_path}/acm:tools_acm_config", 169 ] 170 171 cflags = [] 172 if (target_cpu == "arm") { 173 cflags += [ "-DBINDER_IPC_32BIT" ] 174 } 175 176 deps = [ 177 "${common_path}:libaccount_common", 178 "${os_account_core_path}:os_account_core", 179 "//third_party/googletest:gtest_main", 180 ] 181 182 external_deps = [ 183 "c_utils:utils", 184 "hiviewdfx_hilog_native:libhilog", 185 "ipc:ipc_core", 186 ] 187} 188 189ohos_unittest("account_command_test") { 190 module_out_path = module_output_path 191 192 include_dirs = [] 193 194 sources = [ 195 "${ability_runtime_path}/tools/aa/src/shell_command.cpp", 196 "${tools_path}/acm/src/account_command.cpp", 197 "account_command_test.cpp", 198 ] 199 200 configs = [ 201 "${ability_runtime_path}/tools/aa:ability_command_config", 202 "${tools_path}/acm:tools_acm_config", 203 ] 204 205 cflags = [ "-DENABLE_MULTIPLE_ACTIVE_ACCOUNTS" ] 206 207 if (target_cpu == "arm") { 208 cflags += [ "-DBINDER_IPC_32BIT" ] 209 } 210 211 deps = [ 212 "${common_path}:libaccount_common", 213 "${os_account_core_path}:os_account_core", 214 "//third_party/googletest:gtest_main", 215 ] 216 217 external_deps = [ 218 "c_utils:utils", 219 "hiviewdfx_hilog_native:libhilog", 220 "ipc:ipc_core", 221 ] 222} 223 224group("unittest") { 225 testonly = true 226 227 deps = [ 228 ":account_command_create_test", 229 ":account_command_delete_test", 230 ":account_command_dump_test", 231 ":account_command_set_test", 232 ":account_command_switch_test", 233 ":account_command_test", 234 ] 235} 236